diff --git a/flink-end-to-end-tests/flink-connector-gcp-pubsub-emulator-tests/src/test/java/org/apache/flink/streaming/connectors/gcp/pubsub/CheckPubSubEmulatorTest.java b/flink-end-to-end-tests/flink-connector-gcp-pubsub-emulator-tests/src/test/java/org/apache/flink/streaming/connectors/gcp/pubsub/CheckPubSubEmulatorTest.java index 92a2bc8a64f3d..b0cc81f2d8ee6 100644 --- a/flink-end-to-end-tests/flink-connector-gcp-pubsub-emulator-tests/src/test/java/org/apache/flink/streaming/connectors/gcp/pubsub/CheckPubSubEmulatorTest.java +++ b/flink-end-to-end-tests/flink-connector-gcp-pubsub-emulator-tests/src/test/java/org/apache/flink/streaming/connectors/gcp/pubsub/CheckPubSubEmulatorTest.java @@ -75,6 +75,13 @@ public void testPull() throws Exception { .get(); List receivedMessages = pubsubHelper.pullMessages(PROJECT_NAME, SUBSCRIPTION_NAME, 1); + + //TODO this is just to test if we need to wait longer, or if something has gone wrong and the message will never arrive + if (receivedMessages.isEmpty()) { + LOG.error("Message did not arrive, gonna wait 60s and try to pull again."); + Thread.sleep(30 * 1000); + receivedMessages = pubsubHelper.pullMessages(PROJECT_NAME, SUBSCRIPTION_NAME, 1); + } assertEquals(1, receivedMessages.size()); assertEquals("Hello World PULL", receivedMessages.get(0).getMessage().getData().toStringUtf8());