Skip to content

Commit 4506b07

Browse files
committed
Merge branch 'bugfix/CLDSRV-835-flaky-kmip' into tmp/octopus/w/8.8/bugfix/CLDSRV-835-flaky-kmip
2 parents 352197c + 9464aaf commit 4506b07

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
@@ -124,9 +124,9 @@ describe(`KMS load (kmip cluster ${KMS_NODES} nodes): ${OBJECT_NUMBER
124124
});
125125

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

0 commit comments

Comments
 (0)