Skip to content

Commit 5a37b79

Browse files
rmacnak-googleCommit Queue
authored andcommitted
[test] Ignore failures from the remote side closing the socket in test of handling many pending connections.
TEST=standalone/io/many_pending_secure_sockets_test Bug: #61072 Change-Id: I9ce7130db90c8b04f832a4c4ee7ccdaec97126d0 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/439546 Reviewed-by: Brian Quinlan <[email protected]> Commit-Queue: Ryan Macnak <[email protected]>
1 parent 17fc8b5 commit 5a37b79

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

tests/standalone/io/many_pending_secure_sockets_test.dart

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,18 @@
77
import "dart:io";
88

99
test(int i) async {
10-
var socket = await RawSecureSocket.connect("www.google.com", 443);
11-
await Future.delayed(
12-
Duration(seconds: 6), // More than the thread pool timeout.
13-
);
14-
socket.close();
10+
try {
11+
var socket = await RawSecureSocket.connect("www.google.com", 443);
12+
await Future.delayed(
13+
Duration(seconds: 6), // More than the thread pool timeout.
14+
);
15+
socket.close();
16+
} catch (e, st) {
17+
// Ignore failures from the remote side rejecting/closing the connection.
18+
if (!e.toString().contains("Connection reset by peer")) {
19+
rethrow;
20+
}
21+
}
1522
}
1623

1724
main() async {

0 commit comments

Comments
 (0)