damondouglas commented on code in PR #30218:
URL: https://github.com/apache/beam/pull/30218#discussion_r1480480174
##########
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:
This assertion confused me. Are the total number of records `actualRecords`
+ `remainRecords`? To move this PR along, feel free to resolve this comment
after answering.
##########
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
Review Comment:
Feel free to dismiss if this is not feasible; I don't understand enough
about JMS to know whether what I'm asking here is. Was wondering if this PR
could add:
1) failing test that attempts to resolve pending messages
2) Add `@Ignore` annotation to test and reference a GitHub issue that aims
to resolve failing test.
--
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]