Skip to content

Commit

Permalink
timeout fix
Browse files Browse the repository at this point in the history
Signed-off-by: Attila Mészáros <csviri@gmail.com>
  • Loading branch information
csviri committed Apr 9, 2024
1 parent 08a4bfc commit 8369caf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import io.fabric8.kubernetes.api.model.ObjectMetaBuilder;
import io.quarkus.test.junit.QuarkusTest;

import static io.csviri.operator.resourceglue.TestUtils.GC_WAIT_TIMEOUT_SECOND;
import static io.csviri.operator.resourceglue.customresource.TestCustomResource.CR_GROUP;
import static org.assertj.core.api.Assertions.assertThat;
import static org.awaitility.Awaitility.await;
Expand Down Expand Up @@ -139,12 +140,13 @@ void simpleConcurrencyForMultipleOperatorTest() {
crs.forEach(this::delete);
cr2s.forEach(this::delete);

await().untilAsserted(() -> IntStream.range(0, num).forEach(n -> {
var cm = get(ConfigMap.class, TEST_RESOURCE_PREFIX + n);
assertThat(cm).isNull();
var cm2 = get(ConfigMap.class, TEST_RESOURCE2_PREFIX + n);
assertThat(cm2).isNull();
}));
await().timeout(Duration.ofSeconds(GC_WAIT_TIMEOUT_SECOND))
.untilAsserted(() -> IntStream.range(0, num).forEach(n -> {
var cm = get(ConfigMap.class, TEST_RESOURCE_PREFIX + n);
assertThat(cm).isNull();
var cm2 = get(ConfigMap.class, TEST_RESOURCE2_PREFIX + n);
assertThat(cm2).isNull();
}));
}

TestCustomResource testCustomResource() {
Expand Down
2 changes: 2 additions & 0 deletions src/test/java/io/csviri/operator/resourceglue/TestUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

public class TestUtils {

public static final int GC_WAIT_TIMEOUT_SECOND = 30;

public static final int CRD_READY_WAIT = 1000;

private static final Logger log = LoggerFactory.getLogger(TestUtils.class);
Expand Down

0 comments on commit 8369caf

Please sign in to comment.