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:
roboomp
2026-08-12 15:21:56 +00:00
parent 110f3aac9d
commit 67f9d510e4
+7 -1
View File
@@ -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(),