SEZ9 commented on PR #13154:
URL: https://github.com/apache/seatunnel/pull/13154#issuecomment-6705920167

   Thanks @DanielLeens — all three addressed, and you were right that my 
comment didn't touch the test-design gap.
   
   **Issue 1 (blocking).** You were right and the finding was sharper than the 
severity suggests: I held every other PR in this stack to "remove the fix and a 
test must go red", and then shipped tests here that would have passed with the 
capture line deleted. Testing a private method through reflection tests the 
mechanism, not that anything calls it.
   
   Done as you specified:
   
   1. `retainRestoreCause` is now package-private with `@VisibleForTesting`; 
the reflection helper is gone and the existing cases call it directly.
   2. `JobRuntimeDiagnosticsTest` stubs `getRestoreCauses()` and asserts the 
exact array contents and order, plus an empty array when nothing has restarted. 
Removing the field from the builder now fails a test.
   3. Feasible, so it is in: a new `SubPlanTest` case drives 
`prepareRestorePipeline` with an error seeded the way a failing 
`PhysicalVertex` would set it, and asserts the retained entry is that error 
rather than the placeholder. Deleting the capture line, or moving it after 
`reset()`, turns this red. Reflection is still used to seed the field and reach 
the private method, but only to stand in for the vertex callback — the 
behaviour under test goes through the real method.
   
   **Issue 2.** Fixed in the same push. `prepareRestorePipeline`'s javadoc had 
ended up above `retainRestoreCause`, and `toTimestampsJson`'s above 
`toCausesJson`. I inserted the new members by matching the method signature 
without looking at what preceded it, which is how two existing doc blocks got 
orphaned.
   
   **Issue 3.** Both EN and ZH `rest-api-v2.md` now say `diagnostics` is read 
from the master's in-memory job state, so like `restoreCount` the counters and 
`restoreCauses` start again after a master switch and causes recorded by the 
previous master are not carried over.
   
   **One thing I got wrong in between.** My first push of these fixes 
(`2cc70a83e`) failed all three `unit-test` jobs on a compile error: the new 
tests called `JobRuntimeDiagnostics.build(seaTunnelServer, ...)` when the field 
is named `server`. Fixed in `e66ab2cdc`. That was findable without CI and I 
should have caught it; I have since checked every identifier the new tests 
reference in both files and confirmed each resolves.
   
   Thanks also for finding the green fork run on `d282b869` — I had been 
watching only the apache-side check and had not gone looking for it, so my 
earlier comment claiming "still no verification" was out of date by the time I 
posted 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]

Reply via email to