Skip to content

Commit 011801a

Browse files
committed
Fix another flaky test
1 parent 46a6ba2 commit 011801a

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

internal/venice-test-common/src/integrationTest/java/com/linkedin/venice/endToEnd/ParticipantStoreTest.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,28 +98,31 @@ public void testParticipantStoreKill() {
9898
assertEquals(controllerClient.queryJobStatus(topicName).getStatus(), ExecutionStatus.STARTED.toString());
9999
});
100100
String metricPrefix = "." + clusterName + "-participant_store_consumption_task";
101-
double killedPushJobCount = veniceLocalCluster.getVeniceServers()
101+
// Capture initial metric value (may be > 0 if other tests ran before)
102+
double initialKilledPushJobCount = veniceLocalCluster.getVeniceServers()
102103
.iterator()
103104
.next()
104105
.getMetricsRepository()
105106
.metrics()
106107
.get(metricPrefix + "--killed_push_jobs.Count")
107108
.value();
108-
assertEquals(killedPushJobCount, 0.0);
109109
ControllerResponse response = parentControllerClient.killOfflinePushJob(topicName);
110110
assertFalse(response.isError());
111111
verifyKillMessageInParticipantStore(topicName, true);
112112
String requestMetricExample =
113113
VeniceSystemStoreUtils.getParticipantStoreNameForCluster(clusterName) + "--success_request_key_count.Avg";
114-
TestUtils.waitForNonDeterministicAssertion(30, TimeUnit.SECONDS, true, () -> {
114+
TestUtils.waitForNonDeterministicAssertion(60, TimeUnit.SECONDS, true, () -> {
115115
// Poll job status to verify the job is indeed killed
116116
assertEquals(controllerClient.queryJobStatus(topicName).getStatus(), ExecutionStatus.ERROR.toString());
117117

118118
// Verify participant store consumption stats
119119
// (not sure why these are flaky, but they are, so we're putting them in the non-deterministic assertion loop...)
120120
Map<String, ? extends Metric> metrics =
121121
veniceLocalCluster.getVeniceServers().iterator().next().getMetricsRepository().metrics();
122-
assertEquals(getMetric(metrics, metricPrefix + "--killed_push_jobs.Count").value(), 1.0);
122+
// Verify the metric increased by exactly 1.0 (delta-based checking for test isolation)
123+
assertEquals(
124+
getMetric(metrics, metricPrefix + "--killed_push_jobs.Count").value(),
125+
initialKilledPushJobCount + 1.0);
123126
assertTrue(getMetric(metrics, metricPrefix + "--kill_push_job_latency.Avg").value() > 0);
124127
assertTrue(getMetric(metrics, ".venice-client_" + requestMetricExample).value() > 0);
125128
});

0 commit comments

Comments
 (0)