File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ( )
Original file line number Diff line number Diff 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
4033end
You can’t perform that action at this time.
0 commit comments