Skip to content

Commit 13dbdbf

Browse files
committed
Merge branch 'bugfix/CLDSRV-835-flaky-kmip' into tmp/octopus/w/9.4/bugfix/CLDSRV-835-flaky-kmip
2 parents 46d8f75 + 1c0351f commit 13dbdbf

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

tests/functional/sse-kms-migration/countPacketsByIp.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ PACKETS_COUNT=${2:-1000}
1414
# -n: don't resolve hostnames
1515
# -t: don't print a timestamp
1616
# -q: quiet mode, less verbose output
17-
# -c $PACKETS_COUNT: capture $PACKETS_COUNT packets
18-
# 'tcp dst port $PORT': filter for TCP packets destined for port $PORT
17+
# -c $PACKETS_COUNT: capture exactly $PACKETS_COUNT packets then exit naturally,
18+
# allowing the pipeline (awk | sort | uniq-c) to drain and output results.
19+
# 'tcp dst port $PORT and (tcp[tcpflags] & tcp-push != 0)': PSH-only filter
20+
# so pure ACKs are excluded, keeping counts 1:1 with KMIP requests.
1921

2022
# Output of tcpdump will look like this:
2123
# IP 127.0.0.1.33428 > 127.0.0.3.5696: tcp 341
@@ -29,7 +31,7 @@ PACKETS_COUNT=${2:-1000}
2931
# 323 127.0.0.2
3032
# 345 127.0.0.3
3133

32-
tcpdump -i lo -n -t -q -c $PACKETS_COUNT "tcp dst port ${PORT}" | \
34+
tcpdump -i lo -n -t -q -c $PACKETS_COUNT "tcp dst port ${PORT} and (tcp[tcpflags] & tcp-push != 0)" | \
3335
awk '{print $4}' | \
3436
sed 's/\.[^.]*$//' | \
3537
sort | \

tests/functional/sse-kms-migration/load.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,9 @@ describe(`KMS load (kmip cluster ${KMS_NODES} nodes): ${OBJECT_NUMBER
123123
});
124124

125125
beforeEach(async () => {
126-
// tcpdump can catch more than TOTAL_OBJECTS packets because there are PSH and ACK packets
127-
// but we need to ensure it actually stops before there is no more packets
128-
// to count packets by IP
126+
// tcpdump captures exactly TOTAL_OBJECTS PSH packets then exits naturally,
127+
// allowing the pipeline to drain and output results.
128+
// Consider sending a little more request in case a packet is missed.
129129
tcpdumpProcess = await spawnTcpdump(5696, TOTAL_OBJECTS);
130130
stdout = '';
131131
stderr = '';
@@ -184,7 +184,8 @@ describe(`KMS load (kmip cluster ${KMS_NODES} nodes): ${OBJECT_NUMBER
184184
it(`should encrypt ${TOTAL_OBJECTS} times in parallel, ~${TOTAL_OBJECTS_PER_NODE} per node`, async () => {
185185
await (Promise.all(
186186
buckets.map(async ({ Bucket }) => Promise.all(
187-
new Array(OBJECT_NUMBER).fill(0).map(async (_, i) =>
187+
// Send little more request in case a packet is missed.
188+
new Array(OBJECT_NUMBER + 1).fill(0).map(async (_, i) =>
188189
helpers.s3.putObject({ Bucket, Key: `obj-${i}`, Body: `body-${i}` }))
189190
))
190191
));
@@ -194,7 +195,8 @@ describe(`KMS load (kmip cluster ${KMS_NODES} nodes): ${OBJECT_NUMBER
194195
it(`should decrypt ${TOTAL_OBJECTS} times in parallel, ~${TOTAL_OBJECTS_PER_NODE} per node`, async () => {
195196
await Promise.all(
196197
buckets.map(async ({ Bucket }) => Promise.all(
197-
new Array(OBJECT_NUMBER).fill(0).map(async (_, i) =>
198+
// Send little more request in case a packet is missed.
199+
new Array(OBJECT_NUMBER + 1).fill(0).map(async (_, i) =>
198200
helpers.s3.getObject({ Bucket, Key: `obj-${i}` }))
199201
))
200202
);

0 commit comments

Comments
 (0)