10000 Check for dangling connections/tasks. · zarqman/async-websocket@8428f23 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8428f23

Browse files
committed
Check for dangling connections/tasks.
1 parent b1860a4 commit 8428f23

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

test/async/websocket/client.rb

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,15 @@
1818
let(:timeout) {nil}
1919

2020
it "can connect to a websocket server and close underlying client" do
21-
connection = Async::WebSocket::Client.connect(client_endpoint)
22-
connection.send_text("Hello World!")
23-
message = connection.read
24-
expect(message.to_str).to be == "Hello World!"
25-
connection.close
21+
Async do |task|
22+
connection = Async::WebSocket::Client.connect(client_endpoint)
23+
connection.send_text("Hello World!")
24+
message = connection.read
25+
expect(message.to_str).to be == "Hello World!"
26+
27+
connection.close
28+
expect(task.children).to be(:empty?)
29+
end.wait
2630
end
2731
end
2832

0 commit comments

Comments
 (0)
0