Skip to content

Commit

Permalink
hotfix: flaky test (#1449)
Browse files Browse the repository at this point in the history
* attempt to fix flaky test

* chore: use less starving polling interval

* chore: use less exhausting polling interval
  • Loading branch information
jobulcke authored Dec 5, 2024
1 parent 1b54a1b commit 4dceee5
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import static org.apache.jena.rdf.model.ResourceFactory.createResource;
import static org.assertj.core.api.Assertions.assertThat;
import static org.awaitility.Awaitility.await;
import static org.awaitility.pollinterval.IterativePollInterval.iterative;
import static org.hamcrest.core.StringContains.containsString;
import static org.junit.jupiter.api.Assertions.*;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
Expand Down Expand Up @@ -60,7 +61,9 @@ private void fetchFragment(String path) throws Exception {

@And("I fetch the next fragment through the first {string}")
public void iFetchTheNextFragmentThroughTheFirst(String relation) {
await().atMost(90, TimeUnit.SECONDS)
await()
.atMost(90, TimeUnit.SECONDS)
.pollInterval(iterative(duration -> duration.getSeconds() < 10 ? duration.plus(1, ChronoUnit.SECONDS) : duration))
.untilAsserted(() -> {
fetchFragment(currentPath);
assertNotNull(currentFragment);
Expand Down

0 comments on commit 4dceee5

Please sign in to comment.