davidradl commented on code in PR #27510:
URL: https://github.com/apache/flink/pull/27510#discussion_r2758256821
##########
flink-table/flink-table-runtime/src/test/java/org/apache/flink/table/runtime/util/collections/binary/BytesMultiMapTestBase.java:
##########
@@ -127,6 +129,46 @@ void testBuildAndRetrieve() throws Exception {
}
}
+ /**
+ * Tests that EOFException is thrown when the map exceeds its capacity.
+ *
+ * <p>This test verifies the fix for FLINK-38539: when the record area
offset exceeds
+ * Integer.MAX_VALUE (~2GB), the code now throws EOFException with a clear
message instead of
+ * IndexOutOfBoundsException caused by integer overflow when casting long
to int.
+ *
+ * <p>While this test cannot practically allocate 2GB of memory, it
verifies the EOFException
+ * handling path works correctly when the map is filled to capacity.
+ */
+ @Test
+ void testThrowsEOFExceptionWhenFull() throws Exception {
Review Comment:
Can we have a test with exactly the maximum, one under and one over (or as
close as is feasible with the 4 byte pointer) to make sure that the boundary is
exactly policed as expected please.
--
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]