summaryrefslogtreecommitdiffhomepage
path: root/pkg/gate/gate_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/gate/gate_test.go')
-rw-r--r--pkg/gate/gate_test.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/pkg/gate/gate_test.go b/pkg/gate/gate_test.go
index 5dbd8d712..316015e06 100644
--- a/pkg/gate/gate_test.go
+++ b/pkg/gate/gate_test.go
@@ -15,11 +15,12 @@
package gate_test
import (
- "sync"
+ "runtime"
"testing"
"time"
"gvisor.dev/gvisor/pkg/gate"
+ "gvisor.dev/gvisor/pkg/sync"
)
func TestBasicEnter(t *testing.T) {
@@ -165,6 +166,8 @@ func worker(g *gate.Gate, done *sync.WaitGroup) {
if !g.Enter() {
break
}
+ // Golang before v1.14 doesn't preempt busyloops.
+ runtime.Gosched()
g.Leave()
}
done.Done()