Add extra test

This commit is contained in:
Abhishek Pandey 2024-02-09 20:18:21 -08:00
parent c03bff8755
commit f43647076e
2 changed files with 4 additions and 3 deletions

View File

@ -382,6 +382,7 @@ func wrapAdapter(gra *msgraphsdkgo.GraphRequestAdapter, cc *clientConfig) *adapt
} }
} }
// Graph may abruptly close connections, which we should retry.
var connectionEnded = filters.In([]string{ var connectionEnded = filters.In([]string{
"connection reset by peer", "connection reset by peer",
"client connection force closed", "client connection force closed",

View File

@ -236,13 +236,13 @@ func (suite *GraphIntgSuite) TestAdapterWrap_retriesConnectionInterruptions() {
}, },
{ {
name: "connection reset by peer", name: "connection reset by peer",
providedErr: clues.New("connection reset by peer"), providedErr: clues.New("connection reset by peer what is love"),
expectRetryCount: 7, expectRetryCount: 7,
expectErr: assert.Error, expectErr: assert.Error,
}, },
{ {
name: "read: connection timed out", name: "read: connection timed out",
providedErr: clues.New("read: connection timed out"), providedErr: clues.New("read: connection timed out baby don't hurt me"),
expectRetryCount: 7, expectRetryCount: 7,
expectErr: assert.Error, expectErr: assert.Error,
}, },
@ -260,7 +260,7 @@ func (suite *GraphIntgSuite) TestAdapterWrap_retriesConnectionInterruptions() {
}, },
{ {
name: "non retriable error", name: "non retriable error",
providedErr: clues.New("non retriable error"), providedErr: clues.New("no more"),
expectRetryCount: 1, expectRetryCount: 1,
expectErr: assert.Error, expectErr: assert.Error,
}, },