You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When migrating to the latest version, we noticed (in addition to #1635) that since 5.7.0 multiple calls to LockAssert.TestHelper.makeAllAssertsPass(true) result in multiple test locks (net.javacrumbs.shedlock.core.test-lock).
In previous version one call to LockAssert.TestHelper.makeAllAssertsPass(false) was sufficient to reset the behaviour for the test configuration. Now a LockAssert.TestHelper.makeAllAssertsPass(false) is required for each LockAssert.TestHelper.makeAllAssertsPass(true).
While this can easily be solved in tests by e.g. using a try.. finally or a @BeforeEach + @AfterEach the old behaviour is preferable from our point of view (or alternatively a reset method that clears the ThreadLocal in LockAssert) .
LockAssert.TestHelper.makeAllAssertsPass(true);
LockAssert.TestHelper.makeAllAssertsPass(true);
LockAssert.TestHelper.makeAllAssertsPass(false);
LockAssert.assertLocked(); // although makeAllAssertsPass was set to false the assertion still passes
LockAssert.TestHelper.makeAllAssertsPass(false); // only if makeAllAssertsPass is called with false for each previous call with true the assertion fails
assertThatThrownBy(LockAssert::assertLocked).isInstanceOf(IllegalStateException.class);
The text was updated successfully, but these errors were encountered:
fabianlinz
added a commit
to fabianlinz/ShedLock
that referenced
this issue
Dec 7, 2023
When migrating to the latest version, we noticed (in addition to #1635) that since
5.7.0
multiple calls toLockAssert.TestHelper.makeAllAssertsPass(true)
result in multiple test locks (net.javacrumbs.shedlock.core.test-lock
).In previous version one call to
LockAssert.TestHelper.makeAllAssertsPass(false)
was sufficient to reset the behaviour for the test configuration. Now aLockAssert.TestHelper.makeAllAssertsPass(false)
is required for eachLockAssert.TestHelper.makeAllAssertsPass(true)
.While this can easily be solved in tests by e.g. using a
try.. finally
or a@BeforeEach + @AfterEach
the old behaviour is preferable from our point of view (or alternatively a reset method that clears the ThreadLocal in LockAssert) .Expected behavior
Actual behavior
The text was updated successfully, but these errors were encountered: