mix-test.watch icon indicating copy to clipboard operation
mix-test.watch copied to clipboard

test watch terminating on MacOSX 11.1

Open mydearxym opened this issue 3 years ago • 4 comments

hi there, i upgrade the macOS to 11.1(macOS Big Sur) recently and the test.watch package(latest 1.0.2 ) can not work like before.

> mix test.watch --only wip

20:49:41.954 [error] GenServer MixTestWatch.Watcher terminating
** (FunctionClauseError) no function clause matching in MixTestWatch.Watcher.handle_info/2
    (mix_test_watch 1.0.2) lib/mix_test_watch/watcher.ex:51: MixTestWatch.Watcher.handle_info({:file_event, #PID<0.256.0>, :stop}, [])
    (stdlib 3.13) gen_server.erl:680: :gen_server.try_dispatch/4
    (stdlib 3.13) gen_server.erl:756: :gen_server.handle_msg/6
    (stdlib 3.13) proc_lib.erl:226: :proc_lib.init_p_do_apply/3
Last message: {:file_event, #PID<0.256.0>, :stop}
State: []
MacOSX 10.7 or later required for --file-events

image

should i add --file-events option somewhere ?

mydearxym avatar Feb 02 '21 12:02 mydearxym

Thanks for the report. I don't have one of these machine so I won't be able to help here I'm afraid. I would be interested in knowing whether the file watcher library we use has changed their API.

lpil avatar Feb 02 '21 13:02 lpil

I found the issue. The version of file_system pulled in by this hex is not up to date with macOS Big Sur. (it was fixed in this PR a few months ago: https://github.com/falood/file_system/pull/72)

Make sure you get the latest version of file_system by running mix deps.update mix_test_watch and it should push you to 0.2.10 which works in macOS Big Sur.

atonse avatar Mar 15 '21 03:03 atonse

Wonderful. Perhaps a note in the README is the solution?

lpil avatar Mar 15 '21 09:03 lpil

For me it was necessary to delete the file_system folder in deps folder. And then get deps again.

rm -r ./deps/file_system
mix deps.get

rodeinator avatar Oct 17 '22 16:10 rodeinator

Hi! Is there any updates? I encontured same error at Windows 10:

$ mix test.watch

Running tests...

18:43:45.234 [error] GenServer MixTestWatch.Watcher terminating
** (stop) :enoent
    (elixir 1.14.4) lib/system.ex:1060: System.cmd("cmd", ["/C", "set MIX_ENV=test&& mix test"], [into: %IO.Stream{device: :standard_io, raw: false, line_or_bytes: :line}])
    (mix_test_watch 1.1.0) lib/mix_test_watch/port_runner/port_runner.ex:16: MixTestWatch.PortRunner.run/1
    (mix_test_watch 1.1.0) lib/mix_test_watch/runner.ex:23: MixTestWatch.Runner.run/1
    (mix_test_watch 1.1.0) lib/mix_test_watch/watcher.ex:47: MixTestWatch.Watcher.handle_cast/2
    (stdlib 4.0.1) gen_server.erl:1120: :gen_server.try_dispatch/4
    (stdlib 4.0.1) gen_server.erl:1197: :gen_server.handle_msg/6
    (stdlib 4.0.1) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
Last message: {:"$gen_cast", :run_tasks}
State: []

18:43:45.258 [error] GenServer #PID<0.172.0> terminating
** (stop) :enoent
    (elixir 1.14.4) lib/system.ex:1060: System.cmd("cmd", ["/C", "set MIX_ENV=test&& mix test"], [into: %IO.Stream{device: :standard_io, raw: false, line_or_bytes: :line}])
    (mix_test_watch 1.1.0) lib/mix_test_watch/port_runner/port_runner.ex:16: MixTestWatch.PortRunner.run/1
    (mix_test_watch 1.1.0) lib/mix_test_watch/runner.ex:23: MixTestWatch.Runner.run/1
    (mix_test_watch 1.1.0) lib/mix_test_watch/watcher.ex:47: MixTestWatch.Watcher.handle_cast/2
    (stdlib 4.0.1) gen_server.erl:1120: :gen_server.try_dispatch/4
    (stdlib 4.0.1) gen_server.erl:1197: :gen_server.handle_msg/6
    (stdlib 4.0.1) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
Last message: {:EXIT, #PID<0.171.0>, {:enoent, [{System, :cmd, ["cmd", ["/C", "set MIX_ENV=test&& mix test"], [into: %IO.Stream{device: :standard_io, raw: false, line_or_bytes: :line}]], [file: 'lib/system.ex', line: 1060]}, {MixTestWatch.PortRunner, :run, 1, [file: 'lib/mix_test_watch/port_runner/port_runner.ex', line: 16]}, {MixTestWatch.Runner, :run, 1, [file: 'lib/mix_test_watch/runner.ex', line: 23]}, {MixTestWatch.Watcher, :handle_cast, 2, [file: 'lib/mix_test_watch/watcher.ex', line: 47]}, {:gen_server, :try_dispatch, 4, [file: 'gen_server.erl', line: 1120]}, {:gen_server, :handle_msg, 6, [file: 'gen_server.erl', line: 1197]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 240]}]}}
State: %{port: #Port<0.3>, worker_pid: #PID<0.171.0>}

Additional info:

  1. I have up to date file system in /deps (0.2.10)
  2. test watch version: 1.1
  3. Elixir version: 1.14.4
  4. Erlang/OTP 25 [erts-13.0.4] [64-bit]
  5. Running command in bash as an administrator

RafalKostecki avatar May 17 '23 16:05 RafalKostecki

Looks like you've got a different error there, looks like some file being accessed does not exist. Possibly cmd? Unsure.

lpil avatar May 18 '23 14:05 lpil

Closing this as it the problem macos version was quite some time ago.

lpil avatar May 18 '23 14:05 lpil