Closed scottkurz closed 8 years ago
This issue is really asking that we check for complete TCK coverage of section 10.8.4 of the spec.
For reference, section 10.8.4 defines the following behavior for executing a restarted job (in my own words):
1) Perform Job XML Substitution
2) Set the job restart position to the correct execution element*:
a) If the previous execution was terminated by a
*execution element = a step, flow, split, or decider
To do this somewhat systematically, I'll address each of the different behaviors specified above in a series of comments.
1) This behavior is implicitly tested in almost every test where a job gets restarted, so there is no need to write a test for this specifically.
EDIT: A more thorough test for this is performed in BatchletRestartStateMachineTests.testTransitionElementOnAttrValuesWithRestartJobParamOverrides()
2a), 2b), 3a), and 3b) are all tested by BatchletRestartStateMachineTests.testAllowStartIfCompleteRestartExecution()
3c) is implicitly tested in JobAttributeRestartTests.testJobAttributeRestartableTrue(). A job with one step fails on first execution due to an exception being thrown in the step. This results in a Batch Status of FAILED for both the step and the job on the first execution. On second execution, the step that previously failed is re-executed, and the job proceeds to COMPLETE due to the new (COMPLETED) Batch Status of the re-executed step.
So I think what's left that's interesting to test is that the specific StepExecution passed to a Decider is the correct one, either the earlier execution's or the current's...depending on whether that step executed on THIS job execution.
We'll consider this resolved with commit 8a44e6c06f7f60c244ea63529c4fa99cb614c991
https://java.net/bugzilla/show_bug.cgi?id=5780