From 3aedb2aae86aa66a4f09c42b7d59f6e15ba4a32f Mon Sep 17 00:00:00 2001 From: nateab Date: Mon, 4 Apr 2022 11:00:10 -0700 Subject: [PATCH 1/3] fix: wait longer while waiting for expected spq this fixed another flakey spq integration test so going to try to add it here as well in case it helps. --- .../ScalablePushBandwidthThrottleIntegrationTest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ksqldb-rest-app/src/test/java/io/confluent/ksql/api/integration/ScalablePushBandwidthThrottleIntegrationTest.java b/ksqldb-rest-app/src/test/java/io/confluent/ksql/api/integration/ScalablePushBandwidthThrottleIntegrationTest.java index c0888afcfda6..e4dcfc7e0700 100644 --- a/ksqldb-rest-app/src/test/java/io/confluent/ksql/api/integration/ScalablePushBandwidthThrottleIntegrationTest.java +++ b/ksqldb-rest-app/src/test/java/io/confluent/ksql/api/integration/ScalablePushBandwidthThrottleIntegrationTest.java @@ -280,6 +280,11 @@ private void assertExpectedScalablePushQueries( || !metadata.getScalablePushRegistry().get().latestHasAssignment()) { return false; } + try { + Thread.sleep(100); + } catch (InterruptedException e) { + e.printStackTrace(); + } } return true; }, is(true)); From c719d26e06df0ab0b2c4c352d6bd02c36c908445 Mon Sep 17 00:00:00 2001 From: nateab Date: Mon, 4 Apr 2022 13:39:45 -0700 Subject: [PATCH 2/3] update assertThatEventually to have higher pause --- .../ScalablePushBandwidthThrottleIntegrationTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ksqldb-rest-app/src/test/java/io/confluent/ksql/api/integration/ScalablePushBandwidthThrottleIntegrationTest.java b/ksqldb-rest-app/src/test/java/io/confluent/ksql/api/integration/ScalablePushBandwidthThrottleIntegrationTest.java index e4dcfc7e0700..b7950663b090 100644 --- a/ksqldb-rest-app/src/test/java/io/confluent/ksql/api/integration/ScalablePushBandwidthThrottleIntegrationTest.java +++ b/ksqldb-rest-app/src/test/java/io/confluent/ksql/api/integration/ScalablePushBandwidthThrottleIntegrationTest.java @@ -273,7 +273,7 @@ private void assertAllPersistentQueriesRunning() { private void assertExpectedScalablePushQueries( final int expectedScalablePushQueries ) { - assertThatEventually(() -> { + assertThatEventually("expected scalable push queries", () -> { for (final PersistentQueryMetadata metadata : REST_APP.getEngine().getPersistentQueries()) { if (metadata.getScalablePushRegistry().get().latestNumRegistered() < expectedScalablePushQueries @@ -287,6 +287,6 @@ private void assertExpectedScalablePushQueries( } } return true; - }, is(true)); + }, is(true), 100, 1000); } } From 5f301f7447da5726a3c06db9c1b4f0a9d6aa09a2 Mon Sep 17 00:00:00 2001 From: nateab Date: Mon, 4 Apr 2022 13:40:59 -0700 Subject: [PATCH 3/3] remove manual sleep --- .../ScalablePushBandwidthThrottleIntegrationTest.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/ksqldb-rest-app/src/test/java/io/confluent/ksql/api/integration/ScalablePushBandwidthThrottleIntegrationTest.java b/ksqldb-rest-app/src/test/java/io/confluent/ksql/api/integration/ScalablePushBandwidthThrottleIntegrationTest.java index b7950663b090..94cbf95fb59b 100644 --- a/ksqldb-rest-app/src/test/java/io/confluent/ksql/api/integration/ScalablePushBandwidthThrottleIntegrationTest.java +++ b/ksqldb-rest-app/src/test/java/io/confluent/ksql/api/integration/ScalablePushBandwidthThrottleIntegrationTest.java @@ -280,11 +280,6 @@ private void assertExpectedScalablePushQueries( || !metadata.getScalablePushRegistry().get().latestHasAssignment()) { return false; } - try { - Thread.sleep(100); - } catch (InterruptedException e) { - e.printStackTrace(); - } } return true; }, is(true), 100, 1000);