quarkus-zeebe icon indicating copy to clipboard operation
quarkus-zeebe copied to clipboard

waitForIdleState()

Open mvdveek opened this issue 2 years ago • 2 comments

Perhaps it is more a question then a bug.

The Spring implentation for zeebe testing has zeebeTestEngine.waitForIdleState(). This is because of Threading issues with the engine to my understanding.

This the Quarkus implementation also provide something similar?

I am asking this because I have a test for my process which is looking for jobs to be closed when the camunda process is not there yet. Thus failing the test.

mvdveek avatar Jul 19 '23 08:07 mvdveek

@mvdveek I don't understand your test. Do you have an example I can look at?

andrejpetras avatar Aug 02 '23 16:08 andrejpetras

@mvdveek you can get the embedded zeebe engine from the static field in ZeebeTestEmbeddedResource. The engine has the method you're looking for:

ZeebeTestEmbeddedResource.ZEEBE_ENGINE.waitForIdleState(Duration.ofSeconds(10L));

shaarmann avatar Jan 03 '24 10:01 shaarmann

In the next version, you can inject ZeebeTestEngine directly into the test.


@InjectZeebeTestEngine
ZeebeTestEngine engine;

test() {
 engine.waitForIdleState(Duration.ofSeconds(10L));
}

andrejpetras avatar May 19 '24 18:05 andrejpetras