Skip to content

Fix stale exception assertion in DeserializingConnectionCallbackTest - #9081

Merged
rzo1 merged 1 commit into
apache:masterfrom
reiabreu:fix/serializable-serializer-negative-length-test
Sep 10, 2026
Merged

Fix stale exception assertion in DeserializingConnectionCallbackTest#9081
rzo1 merged 1 commit into
apache:masterfrom
reiabreu:fix/serializable-serializer-negative-length-test

Conversation

@reiabreu

@reiabreu reiabreu commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Summary

DeserializingConnectionCallbackTest.testJavaFallbackNegativeLengthDroppedAndBatchContinues fails on current master (e.g. run #9080, and on plain master runs), breaking the test (25, Client, ...) CI job.

Root cause

Change

  • Assert KryoException (the exception the hardened path now throws) instead of NegativeArraySizeException.
  • Fix the now-stale comment describing the old allocate-then-fail behavior.

KryoException is already a tolerated deserialization-failure/drop reason (the sibling testTruncatedKryoPayloadDroppedAndBatchContinues asserts it and reuses the same assertBatchDeliversOnlyValidMessages helper), so the batch-continues assertion is unaffected.

Verification

Ran the class locally on JDK 25: Tests run: 10, Failures: 0, Errors: 0 — including the previously failing test.

🤖 Generated with Claude Code

PR apache#9075 added a guard to SerializableSerializer.read() that rejects a
negative java-serialized length with a KryoException before allocating
the array, so the negative-length payload no longer reaches
`new byte[len]` and NegativeArraySizeException is never thrown. Update
testJavaFallbackNegativeLengthDroppedAndBatchContinues (added in apache#9076)
to expect the KryoException the hardened path now throws, and correct
the stale comment. KryoException is already a tolerated drop reason, so
the batch-continues assertion is unaffected.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@rzo1
rzo1 merged commit d9dae3f into apache:master Sep 10, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants