Repository navigation
test(backup): pause the clock in a_resume_loads_from_the_recorded_progress - #1193
Conversation
…gress The resumed job checks for a confirmed heartbeat at most two periods old before its DONE write, 100 ms at the test's 50 ms heartbeat. On a loaded host the beat aged past that, the job stopped as a lost claim with every file loaded, and the test read the record as RUNNING. Run the test on a paused tokio clock, which the heartbeat reads, so a stalled host no longer ages the beat. Fixes #1101
LeeroyHannigan
left a comment
There was a problem hiding this comment.
Looks good. I reproduced your table on this head with main merged in. With main's #[tokio::test], a 150 ms blocking stall before the DONE check fails at the status assertion, left: Running, right: Done. With start_paused = true the same stall passes, and so does a 3 s one. The test still catches a broken resume: with the open file reloaded from 0, it fails at the bulk_load_files assertion. It passed 200 of 200 runs idle and 200 of 200 with 8 busy processes on the host. #997 doesn't reach this test, because this test builds job_runtime.
Please use the PR template for the description.
You could also name the count check in the description, the commit message and the new comment. They name the DONE check as the place the job stopped. The count check right before it (crates/engine/src/backup/restore.rs:873) stops the job the same way and leaves the same RUNNING record, and the paused clock covers both. "Before its count and its DONE write" would cover both.
Fixes #1101.
a_resume_loads_from_the_recorded_progressfailed once under load with the resumed restore job's record stillRunningafter every file was loaded.Before its DONE write, a restore job checks that its last confirmed heartbeat is at most two periods old (
restore.rs, theconfirms_the_claimcheck beforefinish). The test runtime's heartbeat is 50 ms, so the window is 100 ms. On a loaded host the beat aged past that, the job stopped as a lost claim with the load complete, and the record stayedRunning.wait_for_jobswas not the cause:cycle_onspawns the resumed job on the runtime's task tracker before it returns, andrunning_jobs()counts the job until it ends.The heartbeat measures time with
tokio::time::Instant, so this change runs the test as#[tokio::test(start_paused = true)], as other tests in the module already do. A stalled host then cannot age the beat, and the test keeps its 50 ms heartbeat. No product code changes.Testing, with
cargo test -p extenddb-engine --lib:tests.rs:16113,left: Running,right: Donebackup::testsmodule, 5 runscargo +1.97.0 fmt --all -- --check: no changes.cargo +1.97.0 clippy -p extenddb-engine --all-targets --features extenddb-engine/backup-test-hooks -- -D warnings: no warnings.