Skip to content

Commit cbb33fd

Browse files
authored
phd: wait for source to resume before asking to migrate again (#874)
The `import_failure` and `export_failure` PHD tests issue a migration that's expected to fail. After they do, make them wait for the migration source to report that it's Running (and so is ready to migrate again) before actually requesting a second migration.
1 parent 42b8735 commit cbb33fd

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

phd-tests/tests/src/migrate.rs

+18
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,15 @@ mod running_process {
181181
.state;
182182
assert_eq!(target_migration_state, MigrationState::Error);
183183

184+
// Wait for the source to report that it has resumed before requesting
185+
// another migration.
186+
source
187+
.wait_for_state(
188+
InstanceState::Running,
189+
std::time::Duration::from_secs(5),
190+
)
191+
.await?;
192+
184193
// try again. this time, it should work!
185194
target2
186195
.migrate_from(&source, Uuid::new_v4(), MigrationTimeout::default())
@@ -234,6 +243,15 @@ mod running_process {
234243
.state;
235244
assert_eq!(target_migration_state, MigrationState::Error);
236245

246+
// Wait for the source to report that it has resumed before requesting
247+
// another migration.
248+
source
249+
.wait_for_state(
250+
InstanceState::Running,
251+
std::time::Duration::from_secs(5),
252+
)
253+
.await?;
254+
237255
// try again. this time, it should work!
238256
target2
239257
.migrate_from(&source, Uuid::new_v4(), MigrationTimeout::default())

0 commit comments

Comments
 (0)