Skip to content

Commit 7da2bc3

Browse files
aykevldeadprogram
authored andcommitted
ci: make the goroutines test less racy
Since we switched to OS threads for goroutines, the testdata/goroutines.go test has been flaky. Not surprising, if threads need to be scheduled within 1ms on a busy CI system. This PR makes the test a bit less flaky (hopefully) by increasing the time to 100ms.
1 parent 444f5f2 commit 7da2bc3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

testdata/goroutines.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ func init() {
1414
func main() {
1515
println("main 1")
1616
go sub()
17-
time.Sleep(1 * time.Millisecond)
17+
time.Sleep(100 * time.Millisecond)
1818
println("main 2")
19-
time.Sleep(2 * time.Millisecond)
19+
time.Sleep(200 * time.Millisecond)
2020
println("main 3")
2121

2222
// Await a blocking call.
@@ -103,7 +103,7 @@ func acquire(m *sync.Mutex, wg *sync.WaitGroup) {
103103

104104
func sub() {
105105
println("sub 1")
106-
time.Sleep(2 * time.Millisecond)
106+
time.Sleep(200 * time.Millisecond)
107107
println("sub 2")
108108
}
109109

0 commit comments

Comments
 (0)