xtern commented on code in PR #2079:
URL: https://github.com/apache/ignite-3/pull/2079#discussion_r1197562776
##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/table/ItTableScanTest.java:
##########
@@ -336,6 +337,36 @@ public void testGetAndDeleteDuringPureTableScan() throws
Exception {
);
}
+ /**
+ * Ensures that multiple consecutive scan requests with different
requested rows amount
+ * return the expected total number of requested rows.
+ *
+ * @throws Exception If failed.
+ */
+ @Test
+ public void testCompositeScanRequest() throws Exception {
+ int[][] demandPairs = {{3, 1}, {1, 3}};
+
+ for (int[] input : demandPairs) {
+ List<BinaryRow> scannedRows = new ArrayList<>();
+ Publisher<BinaryRow> publisher = internalTable.scan(0, null, null,
null, null, 0, null);
+ CompletableFuture<Void> scanned = new CompletableFuture<>();
+
+ Subscription subscription = subscribeToPublisher(scannedRows,
publisher, scanned);
+
+ subscription.request(input[0]);
+ subscription.request(input[1]);
+
+ int total = input[0] + input[1];
+ waitForCondition(() -> scannedRows.size() == total, 10_000);
+ assertEquals(total, scannedRows.size(), "input=" +
Arrays.toString(input));
Review Comment:
In the previous line, we just wait for a condition. The condition may fail.
But `assertTrue(waitForCondition(...))` will not display the actual number
of rows received. Thus, I prefer to do the final check with an explicit
`assertEquals(...)`. If you insist on adding `assertTrue` I can redo it.
--
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]