We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 68a4a9f commit 63d2c63Copy full SHA for 63d2c63
conformance/protobuf/runner.ex
@@ -1,7 +1,7 @@
1
defmodule Conformance.Protobuf.Runner do
2
@moduledoc false
3
4
- @stdin_read_timeout 5000
+ @stdin_read_timeout 3000
5
6
@spec main() :: :ok
7
def main() do
@@ -51,7 +51,12 @@ defmodule Conformance.Protobuf.Runner do
51
52
defp read_bytes(device, count, timeout) do
53
task = Task.async(fn -> IO.binread(device, count) end)
54
- Task.await(task, timeout)
+
55
+ case Task.yield(task, timeout) || Task.shutdown(task) do
56
+ {:ok, bytes} -> bytes
57
+ {:exit, reason} -> raise "failed to read bytes from stdio: #{inspect(reason)}"
58
+ nil -> raise "failed to read bytes from stdio, timed out"
59
+ end
60
end
61
62
defp handle_encoded_request(encoded_request) do
0 commit comments