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
This problem was already addressed in #221 with version 4.7.0 but looks like the problem still happens with version 6.0.2.
The text was updated successfully, but these errors were encountered:
lackovic
changed the title
@Scheduled(...) @SchedulerLock(name = "scheduledTaskName") public void scheduledTask() { LockAssert.assertLocked(); // do something }
assertLocked fails with IllegalStateException: The task is not locked.
Nov 29, 2024
and I found out that changing the interceptMode to PROXY_METHOD makes both the application and the tests work without throwing the IllegalStateException, regardless of the versions of Shedlock or Spring Boot used.
I can't explain though why, using PROXY_SCHEDULER, the combination of Shedlock to 6.0.2 and Spring Boot to 3.4.0 solves the issue for the running application but not for the tests.
The following code:
throws the exception:
using Shedlock 5.16.0 with Spring Boot 3.4.0.
Either downgrading Spring Boot to 3.3.5 or upgrading Shedlock to 6.0.2 solves the issue.
How can I write an integration test to verify the
IllegalStateException
is not thrown? I tried with the following:but this always fail with the same error, regardless of the versions of Shedlock or Spring Boot used:
This problem was already addressed in #221 with version 4.7.0 but looks like the problem still happens with version 6.0.2.
The text was updated successfully, but these errors were encountered: