move aws backoff to its own file, and use it for redshift basic emitter
This commit is contained in:
parent
e42dd7f73d
commit
e6a0af7ffd
1 changed files with 4 additions and 2 deletions
|
|
@ -6,6 +6,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/ezoic/go-kinesis"
|
||||
"github.com/lib/pq"
|
||||
)
|
||||
|
||||
func Test_isRecoverableError(t *testing.T) {
|
||||
|
|
@ -21,6 +22,8 @@ func Test_isRecoverableError(t *testing.T) {
|
|||
{err: &net.OpError{Err: fmt.Errorf("connection reset by peer")}, isRecoverable: true},
|
||||
{err: &net.OpError{Err: fmt.Errorf("unexpected error")}, isRecoverable: false},
|
||||
{err: fmt.Errorf("an arbitrary error"), isRecoverable: false},
|
||||
{err: pq.Error{Message: "The specified S3 prefix 'somefilethatismissing' does not exist"}, isRecoverable: true},
|
||||
{err: pq.Error{Message: "Some other pq error"}, isRecoverable: false},
|
||||
|
||||
//"InternalFailure": true,
|
||||
//"Throttling": true,
|
||||
|
|
@ -31,8 +34,7 @@ func Test_isRecoverableError(t *testing.T) {
|
|||
|
||||
for idx, tc := range testCases {
|
||||
|
||||
p := Pipeline{}
|
||||
isRecoverable := p.isRecoverableError(tc.err)
|
||||
isRecoverable := isRecoverableError(tc.err)
|
||||
if isRecoverable != tc.isRecoverable {
|
||||
t.Errorf("test case %d: isRecoverable expected %t, actual %t, for error %+v", idx, tc.isRecoverable, isRecoverable, tc.err)
|
||||
}
|
||||
Loading…
Reference in a new issue