Skip to content

Commit

Permalink
Add delay in the delete test verification to work around service dele…
Browse files Browse the repository at this point in the history
…te cache (Azure#23313)
  • Loading branch information
pallavit authored Aug 3, 2021
1 parent fd6b9ab commit 566badb
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,17 @@ public void deleteRepositoryByRegistryAsyncClient() {
.delaySubscription(Duration.ofMillis(SLEEP_TIME_IN_MILLISECONDS))
.then(registryAsyncClient.getRepository(repositoryName).getProperties())
.flatMap(res -> Mono.just(false))
.onErrorResume(res -> registryAsyncClient.getRepository(repositoryName)
.delete()
.then(Mono.just(true))
.onErrorResume(err -> Mono.just(false)));
.onErrorResume(res -> {
System.out.println("First time:" + res.getStackTrace());
return registryAsyncClient.getRepository(repositoryName)
.delete()
.delaySubscription(Duration.ofMillis(SLEEP_TIME_IN_MILLISECONDS))
.then(Mono.just(true))
.onErrorResume(err -> {
System.out.println("Second Time:" + err.getStackTrace());
return Mono.just(false);
});
});

StepVerifier.create(deleteRepositoryTest)
.assertNext(Assertions::assertTrue)
Expand Down

0 comments on commit 566badb

Please sign in to comment.