Skip to content

Commit

Permalink
Fixes #2268. Fix LibTest/io/WebSocket/closeCode_A01_t02.dart to be no…
Browse files Browse the repository at this point in the history
…t racy (#2302)
  • Loading branch information
sgrekhov authored Oct 10, 2023
1 parent c026748 commit dc7dd6a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions LibTest/io/WebSocket/closeCode_A01_t02.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,15 @@ import "../../../Utils/expect.dart";
main() {
HttpServer.bind("127.0.0.1", 0).then((server) {
server.listen((request) {
WebSocketTransformer
.upgrade(request)
.then((websocket) {
WebSocketTransformer.upgrade(request).then((websocket) {
websocket.close(WebSocketStatus.normalClosure);
});
});

var webs = WebSocket.connect("ws://127.0.0.1:${server.port}/");
webs.then((client) async {
Expect.isNull(client.closeCode);
await client.listen((_) {}).asFuture();
await server.close();
client.close().then((_) {
Expect.equals(WebSocketStatus.normalClosure, client.closeCode);
Expand Down

0 comments on commit dc7dd6a

Please sign in to comment.