Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/tests/mysqlbackup: fix non-deterministic failure #40258

Merged
merged 1 commit into from May 12, 2018

Conversation

xeji
Copy link
Contributor

@xeji xeji commented May 9, 2018

Motivation for this change

Test sometimes failed on Hydra as it looked for a backup file that was not yet created.

Fixed by waiting for backup to finish and backup file to appear.

@xeji xeji mentioned this pull request May 9, 2018
41 tasks
@grahamc
Copy link
Member

grahamc commented May 9, 2018

@GrahamcOfBorg eval

@@ -23,17 +23,24 @@ import ./make-test.nix ({ pkgs, ... } : {
testScript =
'' startAll;

# delete backup file that may be left over from a previous run
$master->execute("rm -f /var/backup/mysql/testdb.gz");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case the service run just before the test or when does it happen?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not necessary on Hydra. It's useful for repeated test runs on a local machine using nixos-test-driver because the disk image isn't rebuilt in that case and the file persists.

@@ -23,17 +23,24 @@ import ./make-test.nix ({ pkgs, ... } : {
testScript =
'' startAll;

# delete backup file that may be left over from a previous run
$master->execute("rm -f /var/backup/mysql/testdb.gz");

# Need to have mysql started so that it can be populated with data.
$master->waitForUnit("mysql.service");

# Wait for testdb to be populated.
$master->sleep(10);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there way to replace this by a command that checks if the database have been added?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, let me see..

Sometimes failed because of delayed creation of the backup file.
@xeji
Copy link
Contributor Author

xeji commented May 10, 2018

@GrahamcOfBorg test mysql-backup

@GrahamcOfBorg
Copy link

No attempt on aarch64-linux (full log)

The following builds were skipped because they don't evaluate on aarch64-linux: tests.mysql-backup

Partial log (click to expand)

Cannot nix-instantiate `tests.mysql-backup' because:
�[31;1merror:�[0m attribute 'mysql-backup' in selection path 'tests.mysql-backup' not found

@GrahamcOfBorg
Copy link

No attempt on x86_64-linux (full log)

The following builds were skipped because they don't evaluate on x86_64-linux: tests.mysql-backup

Partial log (click to expand)

Cannot nix-instantiate `tests.mysql-backup' because:
error: attribute 'mysql-backup' in selection path 'tests.mysql-backup' not found

@xeji
Copy link
Contributor Author

xeji commented May 10, 2018

@GrahamcOfBorg test mysqlBackup

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: tests.mysqlBackup

Partial log (click to expand)

master: exit status 1
syncing
master: running command: sync
master: exit status 0
test script finished in 25.43s
cleaning up
killing master (pid 627)
vde_switch: EOF on stdin, cleaning up and exiting
vde_switch: Could not remove ctl dir '/build/vde1.ctl': Directory not empty
/nix/store/dy4xkwa79864m5s80x58i22x6c32v1lw-vm-test-run-mysql-backup

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: tests.mysqlBackup

Partial log (click to expand)

master: exit status 1
syncing
master: running command: sync
master: exit status 0
test script finished in 23.93s
cleaning up
killing master (pid 593)
vde_switch: EOF on stdin, cleaning up and exiting
vde_switch: Could not remove ctl dir '/build/vde1.ctl': Directory not empty
/nix/store/4ffpx2ma970qdvlzxfar9z4dbbbj6y2v-vm-test-run-mysql-backup

Copy link
Contributor

@rvl rvl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Works and looks good.

@xeji xeji merged commit a19cc36 into NixOS:master May 12, 2018
@xeji xeji deleted the fix-mysql-backup-test branch May 12, 2018 09:37
xeji added a commit that referenced this pull request May 12, 2018
Sometimes failed because of delayed creation of the backup file.

(cherry picked from commit a19cc36)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants