Repository navigation
Port SplittableParDoProcessFnTest off DoFnTester - #40865
Rishavbhattarai wants to merge 1 commit into
Conversation
Run ProcessFn through DoFnRunners.simpleRunner, the same runner the DirectRunner uses, instead of the deprecated DoFnTester. The ProcessFnTester helper keeps its API, so the test bodies don't change. Fixes apache#18691
There was a problem hiding this comment.
📋 Review Summary
This PR cleanly migrates SplittableParDoProcessFnTest off the deprecated DoFnTester by updating the ProcessFnTester test helper to execute ProcessFn directly via DoFnRunners.simpleRunner. The implementation preserves bundle lifecycle management, state/timer handling, and output verification without needing to alter any of the existing test cases.
🔍 General Feedback
- The setup of
DoFnRunners.simpleRunnerand customWindowedValueMultiReceiveraccurately mirrors howProcessFnis invoked in runners like DirectRunner. - Bundle lifecycle transitions (
setup,startBundle,finishBundle,tearDown) are properly preserved inProcessFnTester.
💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.
|
Assigning reviewers: R: @shunping added as fallback since no labels match configuration Note: If you would like to opt out of this review, comment Available commands:
The PR bot will only process comments in the main thread (not review comments). |
Fixes #18691.
Ports
SplittableParDoProcessFnTestoff the deprecatedDoFnTester.These tests drive
ProcessFnby hand: they advance processing time, fire its timers and check the watermark hold between calls.TestPipelinecan't do that, so I kept theProcessFnTesterhelper and changed what's inside it:ProcessFnnow runs throughDoFnRunners.simpleRunner, the same runnerSplittableProcessElementsEvaluatorFactoryuses in the DirectRunner.StepContexthands it the test's existingInMemoryTimerInternalsandTestInMemoryStateInternals.close()callsfinishBundle()and thenProcessFn.tearDown(), the same orderDoFnTester.close()used.takeOutputElements()andpeekOutputElementsInWindow()read from that list, so none of the test bodies change.DoFnTesterWindowedValueReceiverand theDoFnTesterimport.Testing:
./gradlew :runners:core-java:test --tests SplittableParDoProcessFnTestpasses (15/15), andspotlessCheckis clean.