Skip to content

Commit 9f2e00f

Browse files
committed
quic: temporarily disable preferred address tests
The way the preferred address mechanism is supposed to work is this: A server might be exposed via multiple network interfaces / addresses. The preferred address is the one that clients should use. If a client uses one of the non-preferred addresses to initially connect to the server, the server will include the preferred address in it's initial transport params back to the client over the original connection. The client then can make a choice: it can either choose to ignore the advertised preferred address and continue using the original, or it can transition the in-flight connection to the preferred address without having to restart the connection. In the latter case, the connection will start making use of the preferred address but it might not do so immediately. To test this mechanism properly, we should have our server configured on multiple endpoints with one of those marked as the preferred. The connection should start on one and preceed uninterrupted to completion. If the preferred address policy is "accept", the client will accept and transition to the servers preferred address transparently, without interupting the flow. The current test is deficient because the server is only listening on a single address which is also advertised as the preferred. While the client should get the advertisement, we're not actually making use of the preferred address advertisement and nothing on the connection changes The ipv6 version of the test is also hanging on some platforms and it's not entirely clear why yet. PR-URL: #33934 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
1 parent 46ee864 commit 9f2e00f

File tree

2 files changed

+81
-20
lines changed

2 files changed

+81
-20
lines changed

test/sequential/test-quic-preferred-address-ipv6.js

+34-8
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,38 @@ if (!common.hasQuic)
88
if (!common.hasIPv6)
99
common.skip('missing ipv6');
1010

11-
const Countdown = require('../common/countdown');
11+
// TODO(@jasnell): Temporarily disabling the preferred address
12+
// tests because we need to rethink through how exactly this
13+
// mechanism should work and how we should test it.
14+
//
15+
// The way the preferred address mechanism is supposed to work
16+
// is this: A server might be exposed via multiple network
17+
// interfaces / addresses. The preferred address is the one that
18+
// clients should use. If a client uses one of the non-preferred
19+
// addresses to initially connect to the server, the server will
20+
// include the preferred address in it's initial transport params
21+
// back to the client over the original connection. The client
22+
// then can make a choice: it can either choose to ignore the
23+
// advertised preferred address and continue using the original,
24+
// or it can transition the in-flight connection to the preferred
25+
// address without having to restart the connection. In the latter
26+
// case, the connection will start making use of the preferred
27+
// address but it might not do so immediately.
28+
//
29+
// To test this mechanism properly, we should have our server
30+
// configured on multiple endpoints with one of those marked
31+
// as the preferred. The connection should start on one and preceed
32+
// uninterrupted to completion. If the preferred address policy
33+
// is "accept", the client will accept and transition to the servers
34+
// preferred address transparently, without interupting the flow.
35+
//
36+
// The current test is deficient because the server is only listening
37+
// on a single address which is also advertised as the preferred.
38+
// While the client should get the advertisement, we're not actually
39+
// making use of the preferred address advertisement and nothing on
40+
// the connection changes.
41+
common.skip('preferred address test currently disabled');
42+
1243
const assert = require('assert');
1344
const fixtures = require('../common/fixtures');
1445
const key = fixtures.readKey('agent1-key.pem', 'binary');
@@ -25,12 +56,6 @@ const server = createQuicSocket({ endpoint: { type: 'udp6' } });
2556

2657
const kALPN = 'zzz'; // ALPN can be overriden to whatever we want
2758

28-
const countdown = new Countdown(1, () => {
29-
debug('Countdown expired. Destroying sockets');
30-
server.close();
31-
client.close();
32-
});
33-
3459
server.listen({ key, cert, ca, alpn: kALPN, preferredAddress: {
3560
port: common.PORT,
3661
address: '::',
@@ -87,7 +112,8 @@ server.on('ready', common.mustCall(() => {
87112
stream.resume();
88113

89114
stream.on('close', common.mustCall(() => {
90-
countdown.dec();
115+
server.close();
116+
client.close();
91117
}));
92118
}));
93119

test/sequential/test-quic-preferred-address.js

+47-12
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,38 @@ const common = require('../common');
55
if (!common.hasQuic)
66
common.skip('missing quic');
77

8-
const Countdown = require('../common/countdown');
8+
// TODO(@jasnell): Temporarily disabling the preferred address
9+
// tests because we need to rethink through how exactly this
10+
// mechanism should work and how we should test it.
11+
//
12+
// The way the preferred address mechanism is supposed to work
13+
// is this: A server might be exposed via multiple network
14+
// interfaces / addresses. The preferred address is the one that
15+
// clients should use. If a client uses one of the non-preferred
16+
// addresses to initially connect to the server, the server will
17+
// include the preferred address in it's initial transport params
18+
// back to the client over the original connection. The client
19+
// then can make a choice: it can either choose to ignore the
20+
// advertised preferred address and continue using the original,
21+
// or it can transition the in-flight connection to the preferred
22+
// address without having to restart the connection. In the latter
23+
// case, the connection will start making use of the preferred
24+
// address but it might not do so immediately.
25+
//
26+
// To test this mechanism properly, we should have our server
27+
// configured on multiple endpoints with one of those marked
28+
// as the preferred. The connection should start on one and preceed
29+
// uninterrupted to completion. If the preferred address policy
30+
// is "accept", the client will accept and transition to the servers
31+
// preferred address transparently, without interupting the flow.
32+
//
33+
// The current test is deficient because the server is only listening
34+
// on a single address which is also advertised as the preferred.
35+
// While the client should get the advertisement, we're not actually
36+
// making use of the preferred address advertisement and nothing on
37+
// the connection changes.
38+
common.skip('preferred address test currently disabled');
39+
940
const assert = require('assert');
1041
const fixtures = require('../common/fixtures');
1142
const key = fixtures.readKey('agent1-key.pem', 'binary');
@@ -22,17 +53,19 @@ const server = createQuicSocket();
2253

2354
const kALPN = 'zzz'; // ALPN can be overriden to whatever we want
2455

25-
const countdown = new Countdown(1, () => {
26-
debug('Countdown expired. Destroying sockets');
27-
server.close();
28-
client.close();
29-
});
30-
31-
server.listen({ key, cert, ca, alpn: kALPN, preferredAddress: {
56+
server.listen({
3257
port: common.PORT,
3358
address: '0.0.0.0',
34-
type: 'udp4',
35-
} });
59+
key,
60+
cert,
61+
ca,
62+
alpn: kALPN,
63+
preferredAddress: {
64+
port: common.PORT,
65+
address: '0.0.0.0',
66+
type: 'udp4',
67+
}
68+
});
3669

3770
server.on('session', common.mustCall((session) => {
3871
debug('QuicServerSession Created');
@@ -59,14 +92,15 @@ server.on('ready', common.mustCall(() => {
5992
cert,
6093
ca,
6194
alpn: kALPN,
62-
preferredAddressPolicy: 'accept' } });
95+
} });
6396

6497
client.on('close', common.mustCall());
6598

6699
const req = client.connect({
67100
address: 'localhost',
68101
port: endpoint.address.port,
69102
servername: 'localhost',
103+
preferredAddressPolicy: 'accept',
70104
});
71105

72106
req.on('ready', common.mustCall(() => {
@@ -83,7 +117,8 @@ server.on('ready', common.mustCall(() => {
83117
stream.resume();
84118

85119
stream.on('close', common.mustCall(() => {
86-
countdown.dec();
120+
server.close();
121+
client.close();
87122
}));
88123
}));
89124

0 commit comments

Comments
 (0)