go-zero/core/load/nopshedder_test.go
2020-07-26 17:09:05 +08:00

22 lines
308 B
Go

package load
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestNopShedder(t *testing.T) {
Disable()
shedder := NewAdaptiveShedder()
for i := 0; i < 1000; i++ {
p, err := shedder.Allow()
assert.Nil(t, err)
p.Fail()
}
p, err := shedder.Allow()
assert.Nil(t, err)
p.Pass()
}