imaffe commented on a change in pull request #17937:
URL: https://github.com/apache/flink/pull/17937#discussion_r763936530
##########
File path:
flink-connectors/flink-connector-pulsar/src/test/java/org/apache/flink/connector/pulsar/source/enumerator/PulsarSourceEnumeratorTest.java
##########
@@ -112,64 +119,270 @@ void startWithPeriodicPartitionDiscovery() throws
Exception {
}
}
- private PulsarSourceEnumerator createEnumerator(
+ @ParameterizedTest
+ @EnumSource(
+ value = SubscriptionType.class,
+ names = {"Failover", "Shared"})
+ void discoverPartitionsTriggersAssignments(SubscriptionType
subscriptionType) throws Throwable {
+ Set<String> prexistingTopics = setupPreexistingTopics();
+ try (MockSplitEnumeratorContext<PulsarPartitionSplit> context =
+ new MockSplitEnumeratorContext<>(NUM_SUBTASKS);
+ PulsarSourceEnumerator enumerator =
+ createEnumerator(
+ subscriptionType,
+ prexistingTopics,
+ context,
+ DISABLE_PERIODIC_PARTITION_DISCOVERY)) {
+
+ enumerator.start();
+
+ // register reader 0, 1
+ registerReader(context, enumerator, READER0);
+ registerReader(context, enumerator, READER1);
+ assertTrue(context.getSplitsAssignmentSequence().isEmpty());
+
+ // Run the partition discover callable and check the partition
assignment.
+ runOneTimePartitionDiscovery(context);
+ verifyLastReadersAssignments(subscriptionType, context,
prexistingTopics, 1);
+ }
+ }
+
+ @ParameterizedTest
+ @EnumSource(
+ value = SubscriptionType.class,
+ names = {"Failover", "Shared"})
+ @Timeout(value = 60)
Review comment:
Yeah I recall there is a azure timeout for each test. If that is the
case I don't need the timeout on JUnit.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]