Skip to content

Commit

Permalink
fix flaky test
Browse files Browse the repository at this point in the history
  • Loading branch information
ysmood committed Jul 30, 2024
1 parent ee640c3 commit 945ca02
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions page_eval_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,13 +218,13 @@ func TestConcurrentEval(t *testing.T) {

start := time.Now()
utils.All(func() {
list <- p.MustEval(`() => new Promise(r => setTimeout(r, 2000, 2))`).Int()
list <- p.MustEval(`() => new Promise(r => setTimeout(r, 2500, 2))`).Int()
}, func() {
list <- p.MustEval(`() => new Promise(r => setTimeout(r, 1000, 1))`).Int()
list <- p.MustEval(`() => new Promise(r => setTimeout(r, 1500, 1))`).Int()
})()
duration := time.Since(start)

g.Gt(duration, 1000*time.Millisecond)
g.Gt(duration, 1500*time.Millisecond)
g.Lt(duration, 3000*time.Millisecond)
g.Eq([]int{<-list, <-list}, []int{1, 2})
}
Expand Down

0 comments on commit 945ca02

Please sign in to comment.