jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Phillips <notificati...@github.com>
Subject Re: [jclouds] Retry on S3 HTTP 504 Gateway Timeout status codes (#317)
Date Wed, 19 Mar 2014 02:27:51 GMT
> @@ -112,4 +113,21 @@ public Integer answer() throws Throwable {
>  
>     }
>  
> +   @Test
> +   public void test504DoesRetry() {
> +      AWSUtils utils = createMock(AWSUtils.class);
> +      HttpCommand command = createMock(HttpCommand.class);
> +      expect(command.getFailureCount()).andReturn(1).anyTimes();
> +      expect(command.incrementFailureCount()).andReturn(1);
> +      expect(command.isReplayable()).andReturn(true);
> +
> +      replay(utils, command);
> +
> +      AWSServerErrorRetryHandler retry = new AWSServerErrorRetryHandler(utils,
> +            ImmutableSet.<String> of());
> +
> +      assertTrue(retry.shouldRetryRequest(command, HttpResponse.builder().statusCode(504).build()));

I guess this returns true because the `super.shouldRetryRequest` call will return true?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/317/files#r10735049
Mime
View raw message