Skip to content

Commit

Permalink
Fix flaky integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
adejanovski committed Sep 2, 2021
1 parent 831b915 commit a13eb66
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 24 deletions.
38 changes: 32 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,21 +131,28 @@ jobs:
cassandra-version: [1.2.19, 2.0.17, 2.1.22, 2.2.19, 3.0.25, 3.11.11, 4.0.0, 'github:apache/trunk']
storage-type: [local]
test-type: [ccm]
experimental: [false]
include:
# don't run against the following C* versions when using cassandra storage type
- cassandra-version: 1.2.19
cucumber-options: '--tags ~@cassandra_2_1_onwards --tags ~@cassandra_4_0_onwards --tags ~@cassandra_3_11_onwards'
experimental: false
- cassandra-version: 2.0.17
cucumber-options: '--tags ~@cassandra_2_1_onwards --tags ~@cassandra_4_0_onwards --tags ~@cassandra_3_11_onwards'
experimental: false
- cassandra-version: 2.1.22
cucumber-options: '--tags ~@cassandra_4_0_onwards --tags ~@cassandra_3_11_onwards'
experimental: false
- cassandra-version: 2.2.19
cucumber-options: '--tags ~@cassandra_4_0_onwards --tags ~@cassandra_3_11_onwards'
experimental: false
- cassandra-version: 3.0.25
cucumber-options: '--tags ~@cassandra_4_0_onwards --tags ~@cassandra_3_11_onwards'
experimental: false
- cassandra-version: 3.11.11
cucumber-options: '--tags ~@cassandra_4_0_onwards'
experimental: false
- cassandra-version: 4.0.0
experimental: false
- cassandra-version: 'github:apache/trunk'
experimental: true
steps:
Expand Down Expand Up @@ -313,16 +320,21 @@ jobs:
cassandra-version: [2.1.22, 2.2.19, 3.0.25, 3.11.11, 4.0.0, 'github:apache/trunk']
storage-type: [cassandra]
test-type: [ccm]
experimental: [false]
include:
- cassandra-version: 2.1.22
cucumber-options: '--tags ~@cassandra_4_0_onwards --tags ~@cassandra_3_11_onwards'
experimental: false
- cassandra-version: 2.2.19
cucumber-options: '--tags ~@cassandra_4_0_onwards --tags ~@cassandra_3_11_onwards'
experimental: false
- cassandra-version: 3.0.25
cucumber-options: '--tags ~@cassandra_4_0_onwards --tags ~@cassandra_3_11_onwards'
experimental: false
- cassandra-version: 3.11.11
cucumber-options: '--tags ~@cassandra_4_0_onwards'
experimental: false
- cassandra-version: 4.0.0
experimental: false
- cassandra-version: 'github:apache/trunk'
experimental: true
steps:
Expand Down Expand Up @@ -467,19 +479,23 @@ jobs:
test-type: [sidecar]
grim-max: [1]
grim-min: [1]
experimental: [false]
# all versions but trunk have the same cucumber options, but we can't declare that more effectively (yet)
include:
- cassandra-version: 2.1.22
cucumber-options: '--tags ~@cassandra_4_0_onwards --tags @sidecar --tags ~@cassandra_3_11_onwards'
experimental: false
- cassandra-version: 2.2.19
cucumber-options: '--tags ~@cassandra_4_0_onwards --tags @sidecar --tags ~@cassandra_3_11_onwards'
experimental: false
- cassandra-version: 3.0.25
cucumber-options: '--tags ~@cassandra_4_0_onwards --tags @sidecar --tags ~@cassandra_3_11_onwards'
experimental: false
- cassandra-version: 3.11.11
cucumber-options: '--tags ~@cassandra_4_0_onwards --tags @sidecar'
experimental: false
- cassandra-version: 4.0.0
cucumber-options: '--tags @sidecar'
experimental: false
- cassandra-version: 'github:apache/trunk'
cucumber-options: '--tags @sidecar'
experimental: true
Expand Down Expand Up @@ -579,11 +595,11 @@ jobs:
test-type: [each]
grim-max: [1]
grim-min: [1]
experimental: [false]
# Reduced scope to shorten the integration test times
include:
- cassandra-version: 4.0.0
cucumber-options: '--tags @sidecar'
experimental: false
- cassandra-version: 'github:apache/trunk'
cucumber-options: '--tags @sidecar'
experimental: true
Expand Down Expand Up @@ -659,17 +675,22 @@ jobs:
test-type: [ccm]
grim-max: [2]
grim-min: [2]
experimental: [false]
include:
# all versions but trunk need to exclude trunk tests
- cassandra-version: 2.1.22
cucumber-options: '--tags ~@cassandra_4_0_onwards --tags ~@cassandra_3_11_onwards'
experimental: false
- cassandra-version: 2.2.19
cucumber-options: '--tags ~@cassandra_4_0_onwards --tags ~@cassandra_3_11_onwards'
experimental: false
- cassandra-version: 3.0.25
cucumber-options: '--tags ~@cassandra_4_0_onwards --tags ~@cassandra_3_11_onwards'
experimental: false
- cassandra-version: 3.11.11
cucumber-options: '--tags ~@cassandra_4_0_onwards'
experimental: false
- cassandra-version: 4.0.0
experimental: false
- cassandra-version: 'github:apache/trunk'
experimental: true
steps:
Expand Down Expand Up @@ -742,17 +763,22 @@ jobs:
test-type: [ccm]
grim-max: [4]
grim-min: [2]
experimental: [false]
include:
# all versions but trunk need to exclude trunk tests
- cassandra-version: 2.1.22
cucumber-options: '--tags ~@cassandra_4_0_onwards --tags ~@cassandra_3_11_onwards'
experimental: false
- cassandra-version: 2.2.19
cucumber-options: '--tags ~@cassandra_4_0_onwards --tags ~@cassandra_3_11_onwards'
experimental: false
- cassandra-version: 3.0.25
cucumber-options: '--tags ~@cassandra_4_0_onwards --tags ~@cassandra_3_11_onwards'
experimental: false
- cassandra-version: 3.11.11
cucumber-options: '--tags ~@cassandra_4_0_onwards'
experimental: false
- cassandra-version: 4.0.0
experimental: false
- cassandra-version: 'github:apache/trunk'
experimental: true
steps:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1286,26 +1286,25 @@ public void a_new_daily_repair_schedule_is_added_that_already_exists_with_force_
String keyspace) throws Throwable {

synchronized (BasicSteps.class) {
RUNNERS.parallelStream().forEach(runner -> {
Map<String, String> params = Maps.newHashMap();
params.put("clusterName", clusterName);
params.put("keyspace", keyspace);
params.put("owner", TestContext.TEST_USER);
params.put("intensity", "0.9");
params.put("scheduleDaysBetween", "1");
params.put("repairParallelism", repairType.equals("incremental") ? "parallel" : "sequential");
params.put("incrementalRepair", repairType.equals("incremental") ? "True" : "False");
params.put("force", "true");
Response response = runner.callReaper("POST", "/repair_schedule", Optional.of(params));
ReaperTestJettyRunner runner = RUNNERS.get(RAND.nextInt(RUNNERS.size()));
Map<String, String> params = Maps.newHashMap();
params.put("clusterName", clusterName);
params.put("keyspace", keyspace);
params.put("owner", TestContext.TEST_USER);
params.put("intensity", "0.9");
params.put("scheduleDaysBetween", "1");
params.put("repairParallelism", repairType.equals("incremental") ? "parallel" : "sequential");
params.put("incrementalRepair", repairType.equals("incremental") ? "True" : "False");
params.put("force", "true");
Response response = runner.callReaper("POST", "/repair_schedule", Optional.of(params));

int status = response.getStatus();
String responseEntity = response.readEntity(String.class);
int status = response.getStatus();
String responseEntity = response.readEntity(String.class);

Assertions.assertThat(
ImmutableList.of(Response.Status.NO_CONTENT.getStatusCode(), Response.Status.CREATED.getStatusCode()))
.withFailMessage(responseEntity)
.contains(status);
});
Assertions.assertThat(
ImmutableList.of(Response.Status.CREATED.getStatusCode()))
.withFailMessage(responseEntity)
.contains(status);
}
}

Expand Down

0 comments on commit a13eb66

Please sign in to comment.