dataDownloadQueue_test.go 535 B

1234567891011121314151617181920
  1. package dataDownloadQueue
  2. import (
  3. "errors"
  4. "testing"
  5. "fwh-toolbox-server/jobs"
  6. )
  7. func TestShouldRetryItemSkipsEmsTimeout(t *testing.T) {
  8. if shouldRetryItem(jobs.ErrEmsLogCallTimeout, 0, 3) {
  9. t.Fatal("timed out EMS file should release the SN for the next file")
  10. }
  11. if shouldRetryItem(jobs.ErrEmsLogCallSlotLost, 0, 3) {
  12. t.Fatal("lost EMS call slot should not immediately summon again")
  13. }
  14. if !shouldRetryItem(errors.New("temporary fetch error"), 0, 3) {
  15. t.Fatal("unrelated transient failure should retain retries")
  16. }
  17. }