Skip to content

Commit a78691e

Browse files
committed
Mitigate unstable tests with more sleep
1 parent 698d26d commit a78691e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/online.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ fn test_none_sink_id() {
9595
});
9696

9797
// give event thread some time to pick up events
98-
std::thread::sleep(Duration::from_millis(5));
98+
std::thread::sleep(Duration::from_millis(50));
9999
assert_eq!(state_changes.load(Ordering::Relaxed), 1); // started
100100

101101
// changing sink_id to 'none' again should make no changes
@@ -110,22 +110,22 @@ fn test_none_sink_id() {
110110
assert_eq!(context.state(), AudioContextState::Suspended);
111111

112112
// give event thread some time to pick up events
113-
std::thread::sleep(Duration::from_millis(5));
113+
std::thread::sleep(Duration::from_millis(50));
114114
assert_eq!(state_changes.load(Ordering::Relaxed), 2); // suspended
115115

116116
context.resume_sync();
117117
assert_eq!(context.state(), AudioContextState::Running);
118118

119119
// give event thread some time to pick up events
120-
std::thread::sleep(Duration::from_millis(5));
120+
std::thread::sleep(Duration::from_millis(50));
121121
assert_eq!(state_changes.load(Ordering::Relaxed), 3); // resumed
122122

123123
context.close_sync();
124124
assert_eq!(context.state(), AudioContextState::Closed);
125125
assert!(sink_stable.load(Ordering::SeqCst));
126126

127127
// give event thread some time to pick up events
128-
std::thread::sleep(Duration::from_millis(5));
128+
std::thread::sleep(Duration::from_millis(50));
129129
assert_eq!(state_changes.load(Ordering::Relaxed), 4); // closed
130130
}
131131

0 commit comments

Comments
 (0)