Skip to content

Commit 4e4f244

Browse files
committed
Try to fix race condition in watcher test
The listen watcher version of this test seems to hiccup from time to time, perhaps this will help.
1 parent a82ebab commit 4e4f244

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/unit/watcher_test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,12 @@ def test_on_stale
125125
file = "#{@dir}/omg"
126126
touch file, Time.now - 2.seconds
127127

128-
watcher.add file
129-
watcher.start
130-
131128
stale = false
132129
watcher.on_stale { stale = true }
133130

131+
watcher.add file
132+
watcher.start
133+
134134
touch file, Time.now
135135

136136
Timeout.timeout(1) { sleep 0.01 until stale }

0 commit comments

Comments
 (0)