-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
Conversation
@GrahamcOfBorg eval |
nixos/tests/mysql-backup.nix
Outdated
@@ -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"); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
nixos/tests/mysql-backup.nix
Outdated
@@ -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); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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..
904fcf8
to
81b1e62
Compare
Sometimes failed because of delayed creation of the backup file.
81b1e62
to
0b1237b
Compare
@GrahamcOfBorg test mysql-backup |
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)
|
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)
|
@GrahamcOfBorg test mysqlBackup |
Success on aarch64-linux (full log) Attempted: tests.mysqlBackup Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: tests.mysqlBackup Partial log (click to expand)
|
There was a problem hiding this 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.
Sometimes failed because of delayed creation of the backup file. (cherry picked from commit a19cc36)
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.