Skip to content

Commit d8864c2

Browse files
committed
flush after receiving autobahn case info
1 parent a04625b commit d8864c2

2 files changed

Lines changed: 10 additions & 9 deletions

File tree

test/fixtures/autobahn_client.ex

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ defmodule AutobahnClient do
4545
:ok
4646
end
4747

48+
def flush do
49+
receive do
50+
_message -> flush()
51+
after
52+
0 -> :ok
53+
end
54+
end
55+
4856
defp get_once(state) do
4957
case decode_buffer(state) do
5058
%{messages: []} = state -> state |> recv() |> get_once()

test/mint/web_socket/autobahn_test.exs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,18 @@ defmodule Mint.WebSocket.AutobahnTest do
1616
describe "Autobahn|Testsuite" do
1717
for case_number <- Range.new(1, AutobahnClient.get_case_count()) do
1818
info = AutobahnClient.get_case_info(case_number)
19+
:ok = AutobahnClient.flush()
1920

2021
if String.starts_with?(info.id, "9.") do
2122
@tag :performance
2223
end
2324

2425
test inspect("case #{info.id} (##{case_number}): #{info.description}", printable_limit: 200) do
2526
assert AutobahnClient.run_case(unquote(case_number)) == :ok
26-
:ok = flush()
27+
:ok = AutobahnClient.flush()
2728

2829
assert AutobahnClient.get_case_status(unquote(case_number)) in ~w[OK NON-STRICT INFORMATIONAL]
2930
end
3031
end
3132
end
32-
33-
defp flush() do
34-
receive do
35-
_message -> flush()
36-
after
37-
0 -> :ok
38-
end
39-
end
4033
end

0 commit comments

Comments
 (0)