Skip to content

Commit

Permalink
Attempt to stabilize thread safety tests
Browse files Browse the repository at this point in the history
Signed-off-by: nscuro <[email protected]>
  • Loading branch information
nscuro committed Feb 13, 2024
1 parent d630029 commit 80d4e4c
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public void triggerVulnerabilityPolicyBundleSyncThreadSafetyForCreateTest() thro

assertThat(responses).hasSize(50);
assertThat(responses).satisfiesOnlyOnce(response -> assertThat(response.getStatus()).isEqualTo(202));
assertThat(responses.stream().filter(response -> response.getStatus() == 409)).hasSize(49);
assertThat(responses.stream().map(Response::getStatus).filter(status -> status != 202)).containsOnly(409);
}

@Test
Expand All @@ -222,7 +222,7 @@ public void triggerVulnerabilityPolicyBundleSyncThreadSafetyForUpdateTest() thro
final ExecutorService executor = Executors.newFixedThreadPool(10);
final var countDownLatch = new CountDownLatch(1);

// Create an existing workflow state that is has a terminal status.
// Create an existing workflow state that has a terminal status.
// Trigger requests will reset it to a PENDING state.
final WorkflowState workflowState = new WorkflowState();
workflowState.setStep(WorkflowStep.POLICY_BUNDLE_SYNC);
Expand Down Expand Up @@ -254,7 +254,7 @@ public void triggerVulnerabilityPolicyBundleSyncThreadSafetyForUpdateTest() thro

assertThat(responses).hasSize(50);
assertThat(responses).satisfiesOnlyOnce(response -> assertThat(response.getStatus()).isEqualTo(202));
assertThat(responses.stream().filter(response -> response.getStatus() == 409)).hasSize(49);
assertThat(responses.stream().map(Response::getStatus).filter(status -> status != 202)).containsOnly(409);
}

@Test
Expand Down

0 comments on commit 80d4e4c

Please sign in to comment.