public static void waitUntil( final BooleanSupplier condition, final int retries, final String message, final Object... args) { doRepeatedly(() -> null).until((r) -> condition.getAsBoolean(), retries, message, args); }
public static void waitUntil(final BooleanSupplier condition) { doRepeatedly(() -> null).until((r) -> condition.getAsBoolean()); }
public static void waitUntil( final BooleanSupplier condition, final int retries, final String message, final Object... args) { doRepeatedly(() -> null).until((r) -> condition.getAsBoolean(), retries, message, args); }
public static void waitUntil( final BooleanSupplier condition, final String message, final Object... args) { doRepeatedly(() -> null).until((r) -> condition.getAsBoolean(), message, args); }
public static void waitUntil( final BooleanSupplier condition, final String message, final Object... args) { doRepeatedly(() -> null).until((r) -> condition.getAsBoolean(), message, args); }
public static void waitUntil(final BooleanSupplier condition) { doRepeatedly(() -> null).until((r) -> condition.getAsBoolean()); }
@Override protected void before() throws Throwable { scheduler = ActorScheduler.newActorScheduler() .setCpuBoundActorThreadCount(1) .setActorClock(controlledActorClock) .build(); scheduler.start(); transport = Transports.newClientTransport("gateway").scheduler(scheduler).build(); msgPackHelper = new MsgPackHelper(); transport.registerEndpoint(nodeId, brokerAddressSupplier.get()); final List<Integer> partitionIds = doRepeatedly(this::getPartitionIds).until(p -> !p.isEmpty()); defaultPartitionId = partitionIds.get(0); }
@Override protected void before() throws Throwable { scheduler = ActorScheduler.newActorScheduler() .setCpuBoundActorThreadCount(1) .setActorClock(controlledActorClock) .build(); scheduler.start(); transport = Transports.newClientTransport("gateway").scheduler(scheduler).build(); msgPackHelper = new MsgPackHelper(); transport.registerEndpoint(nodeId, brokerAddressSupplier.get()); final List<Integer> partitionIds = doRepeatedly(this::getPartitionIds).until(p -> !p.isEmpty()); defaultPartitionId = partitionIds.get(0); }
public TypedRecord<WorkflowInstanceRecord> awaitElementInState( final String elementId, final WorkflowInstanceIntent intent) { final DirectBuffer elementIdAsBuffer = BufferUtil.wrapString(elementId); return doRepeatedly( () -> environmentRule .events() .onlyWorkflowInstanceRecords() .withIntent(intent) .filter(r -> elementIdAsBuffer.equals(r.getValue().getElementId())) .findFirst()) .until(o -> o.isPresent()) .get(); }
public TypedRecord<WorkflowInstanceRecord> awaitElementInState( final String elementId, final WorkflowInstanceIntent intent) { final DirectBuffer elementIdAsBuffer = BufferUtil.wrapString(elementId); return doRepeatedly( () -> environmentRule .events() .onlyWorkflowInstanceRecords() .withIntent(intent) .filter(r -> elementIdAsBuffer.equals(r.getValue().getElementId())) .findFirst()) .until(o -> o.isPresent()) .get(); }
public long write() { final LogStreamRecordWriter writer = new LogStreamWriterImpl(logStream); if (key >= 0) { writer.key(key); } else { writer.positionAsKey(); } writer.metadataWriter(metadata); writer.valueWriter(value); return doRepeatedly(() -> writer.tryWrite()).until(p -> p >= 0); } }
public long write() { final LogStreamRecordWriter writer = new LogStreamWriterImpl(logStream); if (key >= 0) { writer.key(key); } else { writer.positionAsKey(); } writer.metadataWriter(metadata); writer.valueWriter(value); return doRepeatedly(() -> writer.tryWrite()).until(p -> p >= 0); } }
doRepeatedly( () -> streams
doRepeatedly( () -> streams
@Test @Category(UnstableTest.class) // => https://github.com/zeebe-io/zeebe/issues/1250 public void shouldCreateDeploymentOnAllPartitionsWithRestartBroker() { // given apiRule .createCmdRequest() .partitionId(Protocol.DEPLOYMENT_PARTITION) .type(ValueType.DEPLOYMENT, DeploymentIntent.CREATE) .command() .put( "resources", Collections.singletonList(deploymentResource(bpmnXml(WORKFLOW), "process.bpmn"))) .done() .send() .await(); // when brokerRule.restartBroker(); doRepeatedly(apiRule::getPartitionIds).until(p -> !p.isEmpty()); // then assertAnyCreatedDeploymentEventOnPartition(0); assertAnyCreatedDeploymentEventOnPartition(1); assertAnyCreatedDeploymentEventOnPartition(2); }
@Test @Category(UnstableTest.class) // => https://github.com/zeebe-io/zeebe/issues/1250 public void shouldCreateDeploymentOnAllPartitionsWithRestartBroker() { // given apiRule .createCmdRequest() .partitionId(Protocol.DEPLOYMENT_PARTITION) .type(ValueType.DEPLOYMENT, DeploymentIntent.CREATE) .command() .put( "resources", Collections.singletonList(deploymentResource(bpmnXml(WORKFLOW), "process.bpmn"))) .done() .send() .await(); // when brokerRule.restartBroker(); doRepeatedly(apiRule::getPartitionIds).until(p -> !p.isEmpty()); // then assertAnyCreatedDeploymentEventOnPartition(0); assertAnyCreatedDeploymentEventOnPartition(1); assertAnyCreatedDeploymentEventOnPartition(2); }