Skip to content

Commit 4b074be

Browse files
committed
fix fragile test
1 parent e929d6e commit 4b074be

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/fs/walk_test.mbt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,21 @@ async test "walk sequential" {
3030
async test "walk parallel" {
3131
@async.sleep(300)
3232
let log = StringBuilder::new()
33+
let mut i = 0
3334
@fs.walk("test_directory", max_concurrency=2, fn(path, _) {
35+
i = i + 1
3436
log.write_string("handling \{path}\n")
35-
@async.sleep(300)
37+
@async.sleep(if i == 1 { 200 } else { 300 })
3638
log.write_string("finished handling \{path}\n")
37-
@async.sleep(100)
3839
})
3940
inspect(
4041
log.to_string(),
4142
content=(
4243
#|handling test_directory
4344
#|handling test_directory/inner1
4445
#|finished handling test_directory
45-
#|finished handling test_directory/inner1
4646
#|handling test_directory/inner1/inner2
47+
#|finished handling test_directory/inner1
4748
#|finished handling test_directory/inner1/inner2
4849
#|
4950
),

0 commit comments

Comments
 (0)