From 6f14d769b1a01d70e67f10785cf55af5aec4928a Mon Sep 17 00:00:00 2001 From: Brian Caswell Date: Tue, 30 Mar 2021 13:42:19 -0400 Subject: [PATCH 1/3] remove supervisor-is-done upon test completion --- src/agent/onefuzz-supervisor/src/agent/tests.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/agent/onefuzz-supervisor/src/agent/tests.rs b/src/agent/onefuzz-supervisor/src/agent/tests.rs index 50cd0ae18b..59a1692517 100644 --- a/src/agent/onefuzz-supervisor/src/agent/tests.rs +++ b/src/agent/onefuzz-supervisor/src/agent/tests.rs @@ -221,4 +221,6 @@ async fn test_emitted_state_failed_setup() { let coordinator: &CoordinatorDouble = agent.coordinator.downcast_ref().unwrap(); let events = &coordinator.events; assert_eq!(events, &expected_events); + + tokio::fs::remove_file(crate::done::done_path().unwrap()).await.unwrap(); } From e6c41596f4bf094917d686d8d6f2a3c9d6e870ff Mon Sep 17 00:00:00 2001 From: Brian Caswell Date: Tue, 30 Mar 2021 13:57:16 -0400 Subject: [PATCH 2/3] cargo fmt --- src/agent/onefuzz-supervisor/src/agent/tests.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/agent/onefuzz-supervisor/src/agent/tests.rs b/src/agent/onefuzz-supervisor/src/agent/tests.rs index 59a1692517..5e9ea12327 100644 --- a/src/agent/onefuzz-supervisor/src/agent/tests.rs +++ b/src/agent/onefuzz-supervisor/src/agent/tests.rs @@ -222,5 +222,7 @@ async fn test_emitted_state_failed_setup() { let events = &coordinator.events; assert_eq!(events, &expected_events); - tokio::fs::remove_file(crate::done::done_path().unwrap()).await.unwrap(); + tokio::fs::remove_file(crate::done::done_path().unwrap()) + .await + .unwrap(); } From 9bacc4464f33c3c316628a15773eb6bf6075c2d9 Mon Sep 17 00:00:00 2001 From: Brian Caswell Date: Tue, 30 Mar 2021 17:01:04 -0400 Subject: [PATCH 3/3] address comments --- src/agent/onefuzz-supervisor/src/agent/tests.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/agent/onefuzz-supervisor/src/agent/tests.rs b/src/agent/onefuzz-supervisor/src/agent/tests.rs index 5e9ea12327..23d263ad00 100644 --- a/src/agent/onefuzz-supervisor/src/agent/tests.rs +++ b/src/agent/onefuzz-supervisor/src/agent/tests.rs @@ -222,6 +222,8 @@ async fn test_emitted_state_failed_setup() { let events = &coordinator.events; assert_eq!(events, &expected_events); + // TODO: at some point, the underlying tests should be updated to not write + // this file in the first place. tokio::fs::remove_file(crate::done::done_path().unwrap()) .await .unwrap();