initial import
This commit is contained in:
21
core/load/nopshedder_test.go
Normal file
21
core/load/nopshedder_test.go
Normal file
@@ -0,0 +1,21 @@
|
||||
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()
|
||||
}
|
||||
Reference in New Issue
Block a user