You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Try it multiple times, it will reproduce the failure. The reason here is it gave a too-small gap of the time in a limited CPU resource. So the failure will be eliminated by increasing the time gap. But my real proposal is to make it a benchmark test instead of unit test. It should not use time consumption to decide whether the unit test is successful. Github action apparently gives a very small resource of CPU, so it needs much longer time than our modern developing machines.
$ cd pkg/util/sem
$ GOMAXPROCS=1 go test -v
=== RUN TestSemaphore0
--- PASS: TestSemaphore0 (0.10s)
=== RUN TestSemaphoreRobust
--- PASS: TestSemaphoreRobust (1.07s)
=== RUN TestSemaphoreN
semaphore_test.go:153: time too long: 211.624608ms, sem: 799, trans: 800
--- FAIL: TestSemaphoreN (2.33s)
FAIL
exit status 1
FAIL github.com/megaease/easegress/pkg/util/sem 3.624s
See here: #68
The text was updated successfully, but these errors were encountered: