test(natives): waited past background delay in leak check
The leak regression waited only 100ms while the leaked job could not write its marker until a 1s sleep elapsed, so the pre-fix path passed vacuously. Wait past the delay; verified the test fails when the drop-time abort is neutralized. Fixes #8341
This commit is contained in:
@@ -4458,7 +4458,13 @@ replace = [{ pattern = "hello", replacement = "HI" }]
|
||||
)
|
||||
.await
|
||||
.expect("one-shot shell execution");
|
||||
time::sleep(Duration::from_millis(100)).await;
|
||||
// `execute_shell` returns after its short post-exit idle drain (~250ms),
|
||||
// while the background job cannot write the marker until its 1s sleep
|
||||
// elapses. Wait well past that delay so a job that outlived the dropped
|
||||
// session has demonstrably had its chance to run — the pre-fix leak fires
|
||||
// at ~1s and is caught here; the fixed path aborts the task on drop and the
|
||||
// marker never appears.
|
||||
time::sleep(Duration::from_millis(2000)).await;
|
||||
|
||||
assert!(
|
||||
!marker.path().exists(),
|
||||
|
||||
Reference in New Issue
Block a user