Abacn commented on code in PR #30218:
URL: https://github.com/apache/beam/pull/30218#discussion_r1480714479
##########
sdks/java/io/jms/src/test/java/org/apache/beam/sdk/io/jms/JmsIOIT.java:
##########
@@ -196,11 +204,18 @@ public void testPublishingThenReadingAll() throws
IOException {
MetricsReader metricsReader = new MetricsReader(readResult, NAMESPACE);
long actualRecords =
metricsReader.getCounterMetric(READ_ELEMENT_METRIC_NAME);
+ // TODO(yathu) resolve pending messages with direct runner. Due to direct
runner only finalize
+ // checkpoint at very end, there are open consumers (may with buffer)
and O(open_consumer)
+ // message won't get delivered to other session
+ int remainRecords = countRemain(QUEUE);
+ assertTrue(remainRecords < OPTIONS.getNumberOfRecords() * 0.005);
+ LOG.info("has {} messages remain", remainRecords);
+
assertTrue(
String.format(
"actual number of records %d smaller than expected: %d.",
- actualRecords, OPTIONS.getNumberOfRecords()),
- OPTIONS.getNumberOfRecords() <= actualRecords);
+ actualRecords, OPTIONS.getNumberOfRecords() - remainRecords),
+ OPTIONS.getNumberOfRecords() <= actualRecords + remainRecords);
Review Comment:
Adjusted asserts to be more clear and added comments
--
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]