mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-11-15 09:11:22 +00:00
Fix PID readiness race in remote workflow tests
This commit is contained in:
parent
e30c9e549d
commit
fe13561ca5
1 changed files with 6 additions and 2 deletions
|
|
@ -752,7 +752,10 @@ mod tests {
|
|||
|
||||
#[tokio::test]
|
||||
async fn remote_workflow_dropped_waiter_cancels_child_before_checkout_cleanup() {
|
||||
let (fake, git) = fake_git("printf '%s' $$ > pid; exec /bin/sleep 60");
|
||||
// Publish the PID only after writing it: file existence is the readiness
|
||||
// signal.
|
||||
let (fake, git) =
|
||||
fake_git("printf '%s' $$ > pid.tmp; /bin/mv pid.tmp pid; exec /bin/sleep 60");
|
||||
let checkout = tempfile::tempdir().unwrap();
|
||||
let path = checkout.path().to_path_buf();
|
||||
let worker = tokio::spawn(async move {
|
||||
|
|
@ -1154,7 +1157,8 @@ mod tests {
|
|||
#[tokio::test]
|
||||
async fn remote_workflow_timeout_and_cancel_reap_owned_children() {
|
||||
for timeout in [true, false] {
|
||||
let (root, mut git) = fake_git("printf '%s' $$ > pid; exec /bin/sleep 60");
|
||||
let (root, mut git) =
|
||||
fake_git("printf '%s' $$ > pid.tmp; /bin/mv pid.tmp pid; exec /bin/sleep 60");
|
||||
git.timeout = Duration::from_secs(2);
|
||||
let cancel = CancellationToken::new();
|
||||
let trigger = async {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue