Skip to content

Commit 4cd1bf0

Browse files
committed
[~] #722 add end-to-end regression test for PADDING-only in-flight accounting
Open a connection with PMTUD probing enabled, push a sizeable transfer through it, and assert that the probe packets actually left the wire and the data round-trip completed. With the previous broken accounting the PMTUD probes never registered against bytes_in_flight, so cwnd consumption was systematically low; this case_test sweep catches the regression at the integration layer. Wire a new -x 48 handler in test_client.c / test_server.c that enables PMTUD probing, and add the matching shell case to scripts/case_test.sh.
1 parent f7edb96 commit 4cd1bf0

3 files changed

Lines changed: 46 additions & 0 deletions

File tree

scripts/case_test.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4947,4 +4947,31 @@ else
49474947
case_print_result "ack_timestamp_frame_case_6" "fail"
49484948
fi
49494949

4950+
4951+
# issue #722 regression: PADDING-bearing packets (PMTUD probes, Initial
4952+
# coalesce padding) must register against bytes_in_flight. Enable PMTUD on
4953+
# both ends, push a sizeable transfer, and assert that:
4954+
# 1. PMTUD was actually negotiated (enable_pmtud != 0 in conn_destroy),
4955+
# so PADDING-bearing probes were scheduled,
4956+
# 2. inflight accounting was non-zero during the run (counter exercised),
4957+
# 3. the transfer completed end-to-end with no error log.
4958+
killall test_server 2> /dev/null
4959+
clear_log
4960+
echo -e "inflight padding accounting (issue #722) ...\c"
4961+
${SERVER_BIN} -l d -e -x 48 > /dev/null &
4962+
sleep 1
4963+
${CLIENT_BIN} -s 1024000 -l d -t 2 -E -x 48 > stdlog
4964+
transfer_ok=`grep ">>>>>>>> pass" stdlog`
4965+
inflight_nonzero=`grep "|inflight:" clog | grep -v "|inflight:0|" | wc -l`
4966+
pmtud_negotiated=`grep "enable_pmtud:" clog | grep -v "enable_pmtud:0|" | wc -l`
4967+
errlog=`grep_err_log`
4968+
if [ -z "$errlog" ] && [ -n "$transfer_ok" ] && [ "$inflight_nonzero" -gt 0 ] && [ "$pmtud_negotiated" -gt 0 ]; then
4969+
echo ">>>>>>>> pass:1"
4970+
case_print_result "inflight_padding_accounting_issue_722" "pass"
4971+
else
4972+
echo ">>>>>>>> pass:0"
4973+
case_print_result "inflight_padding_accounting_issue_722" "fail"
4974+
fi
4975+
grep_err_log
4976+
49504977
cd -

tests/test_client.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4660,6 +4660,17 @@ int main(int argc, char *argv[]) {
46604660
conn_settings.enable_pmtud = 3;
46614661
}
46624662

4663+
/*
4664+
* issue #722 regression: enable PMTUD so that PADDING-bearing probe
4665+
* packets get scheduled during the transfer. Combined with a sizeable
4666+
* payload, this exercises bytes_in_flight accounting on packets that
4667+
* would previously have slipped past the XQC_IS_ACK_ELICITING guard
4668+
* in xqc_send_ctl_increase_inflight / decrease_inflight.
4669+
*/
4670+
if (g_test_case == 48) {
4671+
conn_settings.enable_pmtud = 3;
4672+
}
4673+
46634674
if (g_test_case == 450) {
46644675
conn_settings.extended_ack_features = 2;
46654676
conn_settings.max_receive_timestamps_per_ack = 45;

tests/test_server.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2500,6 +2500,14 @@ int main(int argc, char *argv[]) {
25002500
conn_settings.enable_pmtud = 3;
25012501
}
25022502

2503+
/*
2504+
* issue #722 regression: peer side of the PMTUD-driven PADDING-only
2505+
* accounting test; see test_client.c case 48 for the rationale.
2506+
*/
2507+
if (g_test_case == 48) {
2508+
conn_settings.enable_pmtud = 3;
2509+
}
2510+
25032511
if (g_test_case == 6) {
25042512
conn_settings.idle_time_out = 10000;
25052513
}

0 commit comments

Comments
 (0)