# HG changeset patch # User Sergey Kandaurov # Date 1702289583 -14400 # Node ID 00124c7d0ef16ef96628e6712e90c0736ee5bf4f # Parent 2c4f1019ee0d23b256a6b0a1bdbd9a068f7d0d45 Tests: made sure migrated QUIC connection didn't get stall. While working on connection migration patches, it was observed that connections could easly stuck due to bugs in bytes in-flight accounting. Added a simple test to make sure more data can be sent after confirming a client's ownership of its new address. diff --git a/quic_migration.t b/quic_migration.t --- a/quic_migration.t +++ b/quic_migration.t @@ -27,7 +27,7 @@ plan(skip_all => '127.0.0.20 local addre unless defined IO::Socket::INET->new( LocalAddr => '127.0.0.20' ); my $t = Test::Nginx->new()->has(qw/http http_v3 cryptx/) - ->has_daemon('openssl')->plan(2); + ->has_daemon('openssl')->plan(3); $t->write_file_expand('nginx.conf', <<'EOF'); @@ -106,6 +106,10 @@ my ($frame) = grep { $_->{type} eq "NCID ($frame) = grep { $_->{type} eq "HEADERS" } @$frames; is($frame->{headers}{'x-ip'}, '127.0.0.20', 'remote addr after migration'); +$frames = $s->read(all => [{ sid => $s->new_stream(), fin => 1 }]); +($frame) = grep { $_->{type} eq "HEADERS" } @$frames; +is($frame->{headers}{'x-ip'}, '127.0.0.20', 'next packets after migration'); + # test that $remote_addr is not truncated while in the process of migration; # the same but migration occurs on receiving a request stream itself, # which is the first non-probing frame on the new path;