Skip to content

Commit 154ffba

Browse files
committed
fixed race condition in tests assuming TEST_EVENT_OBSERVER_SKIP_RETRY is disabled
1 parent 4706d74 commit 154ffba

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

testnet/stacks-node/src/event_dispatcher.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2058,6 +2058,9 @@ mod test {
20582058

20592059
let url = &format!("{}/api", &server.url());
20602060

2061+
// Ensure retrying is enabled on the test (as other tests will run in parallel)
2062+
TEST_EVENT_OBSERVER_SKIP_RETRY.lock().unwrap().replace(false);
2063+
20612064
// Insert payload
20622065
EventObserver::insert_payload(&conn, url, &payload, timeout)
20632066
.expect("Failed to insert payload");
@@ -2129,6 +2132,9 @@ mod test {
21292132

21302133
let observer = EventObserver::new(Some(working_dir.clone()), endpoint, timeout);
21312134

2135+
// Ensure retrying is enabled on the test (as other tests will run in parallel)
2136+
TEST_EVENT_OBSERVER_SKIP_RETRY.lock().unwrap().replace(false);
2137+
21322138
// Call send_payload
21332139
observer.send_payload(&payload, "/test");
21342140

0 commit comments

Comments
 (0)