elixir
elixir copied to clipboard
Task.get_info/1 no case clause matching: nil
Environment
- Elixir & Erlang versions (elixir --version):
Erlang/OTP 20 [erts-9.2.1] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]
Elixir 1.6.1 (compiled with OTP 20)
- Operating system:
macOS 10.13.4 (17E199)
Current behavior
I randomly get the following error log when I run my tests, which seems to be a timing issue:
22:04:31.388 [error] Process #PID<0.966.0> raised an exception
** (CaseClauseError) no case clause matching: nil
(elixir) lib/task.ex:431: Task.get_info/1
(elixir) lib/task.ex:422: anonymous fn/2 in Task.build_stream/3
(elixir) lib/task/supervised.ex:470: Task.Supervised.stream_monitor_loop/2
Since the app is relatively complex, I'm currently not able to narrow down the exact issue. It feels like the main process vanishes before a child can be started 🤔
If I add a sleep in the test itself, it passes without throwing this error log.
Expected behavior
Test succeeds without showing an error log.
Any hint appreciated
Fixed by dccb537b6bfc18cffafebb904543dcb9b5514be5.
@josevalim nice, thanks a bunch! 💪