X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/92d1b6e05e042a0781070e7287b1ceb3e094e852..646ea4328be842f4baa194205618c01910ec49db:/services/keepstore/handler_test.go diff --git a/services/keepstore/handler_test.go b/services/keepstore/handler_test.go index cbfc0bcdab..ad907ef101 100644 --- a/services/keepstore/handler_test.go +++ b/services/keepstore/handler_test.go @@ -50,6 +50,7 @@ type RequestTester struct { // - permissions on, authenticated request, unsigned locator // - permissions on, unauthenticated request, signed locator // - permissions on, authenticated request, expired locator +// - permissions on, authenticated request, signed locator, transient error from backend // func TestGetHandler(t *testing.T) { defer teardown() @@ -152,6 +153,23 @@ func TestGetHandler(t *testing.T) { ExpectStatusCode(t, "Authenticated request, expired locator", ExpiredError.HTTPCode, response) + + // Authenticated request, signed locator + // => 503 Server busy (transient error) + + // Set up the block owning volume to respond with errors + vols[0].(*MockVolume).Bad = true + vols[0].(*MockVolume).BadVolumeError = VolumeBusyError + response = IssueRequest(&RequestTester{ + method: "GET", + uri: signedLocator, + apiToken: knownToken, + }) + // A transient error from one volume while the other doesn't find the block + // should make the service return a 503 so that clients can retry. + ExpectStatusCode(t, + "Volume backend busy", + 503, response) } // Test PutBlockHandler on the following situations: