lzx404243 opened a new issue #1837:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/1837


   ## Bug Report
   
   ### Expected behavior
   Tests 
`io.elasticjob.lite.event.rdb.JobEventRdbStorageTest.assertAddJobStatusTraceEventWhenFailoverWithTaskFailedState`
 and 
`io.elasticjob.lite.event.rdb.JobEventRdbStorageTest.assertAddJobStatusTraceEventWhenFailoverWithTaskStagingState`
 should be idempotent and pass when running twice in the same JVM
   
   ### Actual behavior
   The two tests are not idempotent and fail if run twice in the same JVM
   ### Reason analyze (If you can)
   Each of the tests pollutes some states shared among tests, causing the 
second test run to fail for assertions on the storage's `JobStatusTraceEvent`. 
For instance, the second run of 
`JobEventRdbStorageTest.assertAddJobStatusTraceEventWhenFailoverWithTaskFailedState`
 fails for the following assertion:
   
   ```
   List<JobStatusTraceEvent> jobStatusTraceEvents = 
storage.getJobStatusTraceEvents("fake_failed_failover_task_id");
   assertThat(jobStatusTraceEvents.size(), is(2));
   ```
   ### Steps to reproduce the behavior.
   Run each of the aforementioned tests twice in the same JVM. The second test 
run would fail. 
   
   ### Example codes for reproduce this issue (such as a github link).
   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to