| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
@kaiyaok2 Looks reasonable. How did you come across this issue? |
Sorry, something went wrong.
@stleary The issue is reported by our custom JUnit runner that supports rerunning test suite in the same JVM (different from Surefire where a new JVM is booted for each mvn test cycle) |
Sorry, something went wrong.
|
What problem does this code solve? Does the code still compile with Java6? Risks Changes to the API? Will this require a new release? Should the documentation be updated? Does it break the unit tests? Was any code refactored in this commit? Review status Starting 3-day comment window |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Motivation:
A couple of tests in JSONObjectTest are not idempotent and fail in the second runs in the same JVM, because they pollute states reused by themselves. Specifically, these tests first assume that SingletonEnum.getInstance() or Singleton.getInstance() are in a clean state, and then modify them. However, these instances are not cleaned up after the tests, so the repeated runs fail in the initial sanity check. It shall be good to clean the state pollution so that potential newly introduced tests do not fail in the future due to the shared state polluted by these tests.
Two non-idempotent tests are:
Error messages for both failed tests in the second run:
Proposed Fix
Add a tearDown() method to restore the instances of SingletonEnum and Singleton to default states.