Repository navigation
test: fix NPE in child context completion tests - #729
Merged
zhongkechen merged 1 commit intoSep 22, 2026
Merged
Conversation
zhongkechen
temporarily deployed
to
ai-pr-review-runtime
September 22, 2026 22:17 — with
GitHub Actions
Inactive
hln33
approved these changes
Sep 22, 2026
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Issue Link, if available
No tracking issue. Reproduced from the main-branch Build run, where all three Java versions log this NPE while the tests pass.
Description
The two
ChildContextOperationTestcases for an already-completed parent use a constructor-free Mockito parent whosecompletionFutureis null. When a child finishes,completionLock()returns that null future and the background handler throws an NPE. The tests previously only slept and checked for absent checkpoints, so both still passed.Construct and complete a real
ParallelOperationparent so its completion lock is initialized. Wait for each child handler with a bounded timeout and assert that the child completed before checking that its success/failure checkpoint was skipped. Background handler failures now fail the tests.Demo/Screenshots
Reproduction and regression validation:
NullPointerExceptiontraces are logged.ExecutionExceptionwrapping the null completion-lock error.Checklist
Testing
Unit Tests
Strengthened both existing success/failure cases. Passed:
mvn -B -pl sdk spotless:apply test -Dtest=ChildContextOperationTeston Java 17.mvn -B test spotless:checkon Java 17: 2,016 tests passed, 31 skipped, zero failures/errors; all reactor modules and formatting checks passed. No NPEs in the full test log.mvn -B -pl sdk -Dtest=ChildContextOperationTest teston Java 25: 13 passed.Integration Tests
The full reactor run includes all 405 local SDK integration tests, which passed. No new integration tests are needed for this test-fixture fix. Cloud and external conformance tests were not run.
Examples
No new example is needed. The existing example tests ran as part of the reactor, with opt-in cloud tests skipped.