Skip to content

Commit

Permalink
test(engine): stabilize SignalEventConcurrencyTest (camunda#3526)
Browse files Browse the repository at this point in the history
* Prevents the SignalEventConcurrencyTest from running into unexpected
  concurrent execution of threads.

related to camunda#2904
  • Loading branch information
tmetzke authored Jun 29, 2023
1 parent 060d3dd commit 0e3639e
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
*/
package org.camunda.bpm.engine.test.bpmn.event.signal;

import static org.assertj.core.api.Assertions.assertThat;

import org.camunda.bpm.engine.RepositoryService;
import org.camunda.bpm.engine.RuntimeService;
import org.camunda.bpm.engine.TaskService;
Expand All @@ -39,14 +41,12 @@
import org.junit.rules.RuleChain;
import org.mockito.Mockito;

import static org.assertj.core.api.Assertions.assertThat;

public class SignalEventConcurrencyTest extends ConcurrencyTestHelper {

@ClassRule
public static ProcessEngineBootstrapRule bootstrapRule = new ProcessEngineBootstrapRule();
protected ProvidedProcessEngineRule engineRule = new ProvidedProcessEngineRule(bootstrapRule);
public ProcessEngineTestRule testRule = new ProcessEngineTestRule(engineRule);
protected ProcessEngineTestRule testRule = new ProcessEngineTestRule(engineRule);

@Rule
public RuleChain ruleChain = RuleChain.outerRule(engineRule).around(testRule);
Expand All @@ -57,6 +57,7 @@ public class SignalEventConcurrencyTest extends ConcurrencyTestHelper {
protected EventHandler signalEventHandler;
protected EventHandler evSpy;

@Override
@Before
public void init() {
processEngineConfiguration = engineRule.getProcessEngineConfiguration();
Expand Down Expand Up @@ -114,7 +115,6 @@ public Object execute(final CommandContext commandContext) {
taskService.complete(mainTask.getId());

// unblock the second thread in the handleEvent
signalThread.makeContinue();
signalThread.waitUntilDone(true);

// sending the signal will fail because it cannot find the execution anymore
Expand Down

0 comments on commit 0e3639e

Please sign in to comment.