nopshedder_test.go 308 B

123456789101112131415161718192021
  1. package load
  2. import (
  3. "testing"
  4. "github.com/stretchr/testify/assert"
  5. )
  6. func TestNopShedder(t *testing.T) {
  7. Disable()
  8. shedder := NewAdaptiveShedder()
  9. for i := 0; i < 1000; i++ {
  10. p, err := shedder.Allow()
  11. assert.Nil(t, err)
  12. p.Fail()
  13. }
  14. p, err := shedder.Allow()
  15. assert.Nil(t, err)
  16. p.Pass()
  17. }