X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/898c73ef5179e3c0cdc088ca369500b40df23b89..6613ec1e9c705fb5b950611fd160d4a2babed251:/sdk/go/arvadosclient/arvadosclient_test.go diff --git a/sdk/go/arvadosclient/arvadosclient_test.go b/sdk/go/arvadosclient/arvadosclient_test.go index bf8debe243..8e32efe4f9 100644 --- a/sdk/go/arvadosclient/arvadosclient_test.go +++ b/sdk/go/arvadosclient/arvadosclient_test.go @@ -29,6 +29,11 @@ func (s *ServerRequiredSuite) SetUpSuite(c *C) { RetryDelay = 0 } +func (s *ServerRequiredSuite) TearDownSuite(c *C) { + arvadostest.StopKeep(2) + arvadostest.StopAPI() +} + func (s *ServerRequiredSuite) SetUpTest(c *C) { arvadostest.ResetEnv() } @@ -322,11 +327,16 @@ func (s *MockArvadosServerSuite) TestWithRetries(c *C) { { "get", 0, 401, []int{500, 401, 200}, []string{``, ``, `{"ok":"ok"}`}, }, - // Use nil responseBody to simulate error during request processing - // Even though retryable, the simulated error applies during reties also, and hence "get" also eventually fails in this test. + + // Response code -1 simulates an HTTP/network error + // (i.e., Do() returns an error; there is no HTTP + // response status code). + + // Succeed on second retry { "get", 0, 200, []int{-1, -1, 200}, []string{``, ``, `{"ok":"ok"}`}, }, + // "POST" is not safe to retry: fail after one error { "create", 0, -1, []int{-1, 200}, []string{``, `{"ok":"ok"}`}, },