The following code …
GenStage.sync_subscribe(cons, to: prod)
IO.puts "line 108"
# Wait for process to exit.
Process.monitor(cons)
receive do
{:DOWN, _ref, :process, ^cons, :normal} ->
:ok
{:DOWN, _ref, :process, ^cons, reason} ->
Process.exit(self, reason)
end
… crashes with ** (EXIT from #PID<0.672.0>) no process
but only if the IO.puts
call is present. If I comment it out, the code runs as intended and the corresponding tests pass.
Any ideas how that could be causing it?