testutil.go 277 B

1234567891011121314
  1. package testutil
  2. import (
  3. "runtime"
  4. )
  5. // WARNING: This is a hack.
  6. // Remove this when we are able to block/check the status of the go-routines.
  7. func ForceGosched() {
  8. // possibility enough to sched upto 10 go routines.
  9. for i := 0; i < 10000; i++ {
  10. runtime.Gosched()
  11. }
  12. }