Skip to content

Commit 375fab0

Browse files
authored
Add conditions to check for aerospike version >=5.1 before we run e2e tests (#22228)
* add conditions for 5+ * fix ci
1 parent a6520fa commit 375fab0

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

aerospike/tests/conftest.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,10 @@ def _get_conditions():
5959
WaitFor(init_db),
6060
]
6161

62-
# Wait for Aerospike to calculate latency/throughput metrics (only needed for versions <= 5.0)
62+
# Wait for Aerospike to calculate latency/throughput metrics.
6363
# We use the output of this docker exec command line for checking instead with the client,
6464
# because this is the command used to retrieve the metric and we know its output format.
65+
# Version 5.0 and earlier use the throughput command, while version 5.1 and later use the latencies command.
6566
version = os.environ.get('AEROSPIKE_VERSION', '0.0')
6667
major, minor = map(int, version.split('.')[:2])
6768

@@ -74,6 +75,19 @@ def _get_conditions():
7475
wait=1,
7576
)
7677
)
78+
else:
79+
# For version 5.1+, latencies use a different command
80+
# Pattern requires ':msec' to ensure actual data exists (empty is '{test}-read:;')
81+
# Not ready: batch-index:;{test}-read:;{test}-write:;{test}-udf:;{test}-query:
82+
# Ready: ...;{test}-read:msec,...;{test}-write:msec,...;...
83+
conditions.append(
84+
CheckCommandOutput(
85+
['docker', 'exec', 'aerospike', 'asinfo', '-v', 'latencies:'],
86+
patterns=[r'\{test\}-(read|write):msec'],
87+
attempts=30,
88+
wait=1,
89+
)
90+
)
7791

7892
return conditions
7993

0 commit comments

Comments
 (0)