Skip to content

Commit 09d4483

Browse files
authored
[COR-49] Fix flakiness of query metrics check by eventually asserting (#22156)
* Fix flakiness of query metrics check by eventually asserting * Make sleeping less frequent
1 parent f04dc3f commit 09d4483

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

tests/js/client/aql/aql-query-metrics-fp.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,17 @@ function QueryMetricsTestSuite() {
133133
arango.PUT_RAW('/_api/job/' + cursorsIds[i], "");
134134
}
135135

136-
aqlCurrentQueryMetric = getMetricSingle("arangodb_aql_current_query");
136+
iterations = 0;
137+
// The metrics should eventually reach 0
138+
while (iterations < maxIterations) {
139+
aqlCurrentQueryMetric = getMetricSingle("arangodb_aql_current_query");
140+
if (aqlCurrentQueryMetric === 0) {
141+
break;
142+
}
143+
sleep(0.1);
144+
iterations++;
145+
}
146+
137147
assertEqual(aqlCurrentQueryMetric, 0);
138148
} finally {
139149
IM.debugRemoveFailAt("Query::delayingExecutionPhase");

0 commit comments

Comments
 (0)