Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test delays #9268

Merged
merged 2 commits into from
Jan 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,9 @@ public void manualRun() {
workflowState);

WorkflowClient.start(workflow::run, input);
testEnv.sleep(Duration.ofSeconds(2L));
testEnv.sleep(Duration.ofSeconds(30L));
workflow.submitManualSync();
testEnv.sleep(Duration.ofSeconds(50L));
testEnv.sleep(Duration.ofSeconds(20L));

final Queue<ChangedStateEvent> events = testStateListener.events(testId);

Expand Down Expand Up @@ -231,9 +231,9 @@ public void updatedSignalRecieved() {
workflowState);

WorkflowClient.start(workflow::run, input);
testEnv.sleep(Duration.ofSeconds(2L));
testEnv.sleep(Duration.ofSeconds(30L));
workflow.connectionUpdated();
testEnv.sleep(Duration.ofSeconds(50L));
testEnv.sleep(Duration.ofSeconds(20L));

final Queue<ChangedStateEvent> events = testStateListener.events(testId);

Expand Down Expand Up @@ -272,9 +272,9 @@ public void cancelNonRunning() {
workflowState);

WorkflowClient.start(workflow::run, input);
testEnv.sleep(Duration.ofSeconds(50L));
testEnv.sleep(Duration.ofSeconds(30L));
workflow.cancelJob();
testEnv.sleep(Duration.ofSeconds(2L));
testEnv.sleep(Duration.ofSeconds(20L));

final Queue<ChangedStateEvent> events = testStateListener.events(testId);

Expand Down Expand Up @@ -313,8 +313,9 @@ public void deleteSync() {
workflowState);

WorkflowClient.start(workflow::run, input);
testEnv.sleep(Duration.ofSeconds(30L));
workflow.deleteConnection();
testEnv.sleep(Duration.ofSeconds(50L));
testEnv.sleep(Duration.ofMinutes(20L));

final Queue<ChangedStateEvent> events = testStateListener.events(testId);

Expand Down Expand Up @@ -380,7 +381,7 @@ public void manualRun() {
workflowState);

WorkflowClient.start(workflow::run, input);
testEnv.sleep(Duration.ofSeconds(61L));
testEnv.sleep(Duration.ofMinutes(2L));
workflow.submitManualSync();

final Queue<ChangedStateEvent> events = testStateListener.events(testId);
Expand Down Expand Up @@ -410,15 +411,15 @@ public void cancelRunning() {

WorkflowClient.start(workflow::run, input);
workflow.submitManualSync();
testEnv.sleep(Duration.ofSeconds(1L));
testEnv.sleep(Duration.ofSeconds(30L));
workflow.cancelJob();
testEnv.sleep(Duration.ofSeconds(2L));
testEnv.sleep(Duration.ofMinutes(1L));

final Queue<ChangedStateEvent> events = testStateListener.events(testId);

Assertions.assertThat(events)
.filteredOn(changedStateEvent -> changedStateEvent.getField() == StateField.CANCELLED && changedStateEvent.isValue())
.hasSize(1);
.hasSizeGreaterThanOrEqualTo(1);

Mockito.verify(mJobCreationAndStatusUpdateActivity).jobCancelled(Mockito.any());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public StandardSyncOutput run(final JobRunConfig jobRunConfig,
final StandardSyncInput syncInput,
final UUID connectionId) {

Workflow.sleep(Duration.ofSeconds(2));
Workflow.sleep(Duration.ofMinutes(1));

return new StandardSyncOutput();
}
Expand Down