简体   繁体   English

Elixir 小袋鼠在混合测试中崩溃

[英]Elixir Wallaby crashes on mix test

I am trying to incorporate Wallaby into my phoenix app.我正在尝试将 Wallaby 合并到我的 phoenix 应用程序中。 I have followed the setup guide closely and made sure that phantomjs is properly installed, however on mix test I get the following error:我已密切遵循设置指南并确保正确安装了 phantomjs,但是在混合测试中我收到以下错误:

** (MatchError) no match of right hand side value:

My operating system is Windows10.我的操作系统是Windows10。 Elixir version: 1.10.1 Phoenix version: 1.4.15 Wallaby version: 0.23.0 Phantomjs version: 2.1.1 Here is the full output: Elixir 版本:1.10.1 Phoenix 版本:1.4.15 Wallaby 版本:0.23.0 Phantomjs 版本:2.1.1 这是完整的 output:

mix test

06:21:54.255 [info]  Already up
06:21:55.380 [error] Task #PID<0.486.0> started from #PID<0.488.0> terminating
** (stop) :eacces
    erlang.erl:2213: :erlang.open_port({:spawn_executable, 'C:\\Users\\SARELV~1\\AppData\\Local\\Temp/kz9cgp/wrapper'}, [:binary, :stream, :use_stdio, :exit_status, :stderr_to_stdout, {:args, ["phantomjs", "--webdriver=55182", "--local-storage-path=C:\\Users\\SARELV~1\\AppData\\Local\\Temp/kz9cgp/local_storage"]}])
    (wallaby 0.23.0) lib/wallaby/phantom/server/start_task.ex:85: Wallaby.Phantom.Server.StartTask.start_phantom/1
    (wallaby 0.23.0) lib/wallaby/phantom/server/start_task.ex:28: Wallaby.Phantom.Server.StartTask.run/2
    (elixir 1.10.1) lib/task/supervised.ex:90: Task.Supervised.invoke_mfa/2
    (elixir 1.10.1) lib/task/supervised.ex:35: Task.Supervised.reply/5
    (stdlib 3.8) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Function: &Wallaby.Phantom.Server.StartTask.run/2
    Args: [#PID<0.486.0>, %Wallaby.Phantom.Server.ServerState{phantom_args: [], phantom_os_pid: nil, phantom_path: "phantomjs", port_number: 55182, workspace_path: "C:\\Users\\SARELV~1\\AppData\\Local\\Temp/kz9cgp", wrapper_script_os_pid: nil, wrapper_script_port: nil}]
** (MatchError) no match of right hand side value: {:error, {:wallaby, {{:shutdown, {:failed_to_start_child, Wallaby.Phantom, {:shutdown, {:failed_to_start_child, Wallaby.ServerPool, {{:badmatch, {:error, {:eacces, [{:erlang, :open_port, [{:spawn_executable, 'C:\\Users\\SARELV~1\\AppData\\Local\\Temp/kz9cgp/wrapper'}, [:binary, :stream, :use_stdio, :exit_status, :stderr_to_stdout, {:args, ["phantomjs", "--webdriver=55182", "--local-storage-path=C:\\Users\\SARELV~1\\AppData\\Local\\Temp/kz9cgp/local_storage"]}]], [file: 'erlang.erl', line: 2213]}, {Wallaby.Phantom.Server.StartTask, :start_phantom, 1, [file: 'lib/wallaby/phantom/server/start_task.ex', line: 85]}, {Wallaby.Phantom.Server.StartTask, :run, 2, [file: 'lib/wallaby/phantom/server/start_task.ex', line: 28]}, {Task.Supervised, :invoke_mfa, 2, [file: 'lib/task/supervised.ex', line: 90]}, {Task.Supervised, :reply, 5, [file: 'lib/task/supervised.ex', line: 35]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 249]}]}}}, [{:poolboy, :new_worker, 1, [file: 'c:/Coding/Projects/BoomhuisOnline/boomhuis/deps/poolboy/src/poolboy.erl', line: 283]}, {:poolboy, :prepopulate, 3, [file: 'c:/Coding/Projects/BoomhuisOnline/boomhuis/deps/poolboy/src/poolboy.erl', line: 304]}, {:poolboy, :init, 3, [file: 'c:/Coding/Projects/BoomhuisOnline/boomhuis/deps/poolboy/src/poolboy.erl', line: 153]}, {:gen_server, :init_it, 2, [file: 'gen_server.erl', line: 374]}, {:gen_server, :init_it, 6, [file: 'gen_server.erl', line: 342]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 249]}]}}}}}, {Wallaby, :start, [:normal, []]}}}}
    test/test_helper.exs:5: (file)
    (elixir 1.10.1) lib/code.ex:917: Code.require_file/2
    (elixir 1.10.1) lib/enum.ex:783: Enum."-each/2-lists^foreach/1-0-"/2
    (elixir 1.10.1) lib/enum.ex:783: Enum.each/2
06:21:55.392 [error] GenServer #PID<0.485.0> terminating
** (MatchError) no match of right hand side value: {:error, {:eacces, [{:erlang, :open_port, [{:spawn_executable, 'C:\\Users\\SARELV~1\\AppData\\Local\\Temp/kz9cgp/wrapper'}, [:binary, :stream, :use_stdio, :exit_status, :stderr_to_stdout, {:args, ["phantomjs", "--webdriver=55182", "--local-storage-path=C:\\Users\\SARELV~1\\AppData\\Local\\Temp/kz9cgp/local_storage"]}]], [file: 'erlang.erl', line: 2213]}, {Wallaby.Phantom.Server.StartTask, :start_phantom, 1, [file: 'lib/wallaby/phantom/server/start_task.ex', line: 85]}, {Wallaby.Phantom.Server.StartTask, :run, 2, [file: 'lib/wallaby/phantom/server/start_task.ex', line: 28]}, {Task.Supervised, :invoke_mfa, 2, [file: 'lib/task/supervised.ex', line: 90]}, {Task.Supervised, :reply, 5, [file: 'lib/task/supervised.ex', line: 35]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 249]}]}}
    (poolboy 1.5.2) c:/Coding/Projects/BoomhuisOnline/boomhuis/deps/poolboy/src/poolboy.erl:283: :poolboy.new_worker/1
    (poolboy 1.5.2) c:/Coding/Projects/BoomhuisOnline/boomhuis/deps/poolboy/src/poolboy.erl:304: :poolboy.prepopulate/3
    (poolboy 1.5.2) c:/Coding/Projects/BoomhuisOnline/boomhuis/deps/poolboy/src/poolboy.erl:153: :poolboy.init/3
    (stdlib 3.8) gen_server.erl:374: :gen_server.init_it/2
    (stdlib 3.8) gen_server.erl:342: :gen_server.init_it/6
    (stdlib 3.8) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Last message: {:EXIT, #PID<0.484.0>, {{:badmatch, {:error, {:eacces, [{:erlang, :open_port, [{:spawn_executable, 'C:\\Users\\SARELV~1\\AppData\\Local\\Temp/kz9cgp/wrapper'}, [:binary, :stream, :use_stdio, :exit_status, :stderr_to_stdout, {:args, ["phantomjs", "--webdriver=55182", "--local-storage-path=C:\\Users\\SARELV~1\\AppData\\Local\\Temp/kz9cgp/local_storage"]}]], [file: 'erlang.erl', line: 2213]}, {Wallaby.Phantom.Server.StartTask, :start_phantom, 1, [file: 'lib/wallaby/phantom/server/start_task.ex', line: 85]}, {Wallaby.Phantom.Server.StartTask, :run, 2, [file: 'lib/wallaby/phantom/server/start_task.ex', line: 28]}, {Task.Supervised, :invoke_mfa, 2, [file: 'lib/task/supervised.ex', line: 90]}, {Task.Supervised, :reply, 5, [file: 'lib/task/supervised.ex', line: 35]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 249]}]}}}, [{:poolboy, :new_worker, 1, [file: 'c:/Coding/Projects/BoomhuisOnline/boomhuis/deps/poolboy/src/poolboy.erl', line: 283]}, {:poolboy, :prepopulate, 3, [file: 'c:/Coding/Projects/BoomhuisOnline/boomhuis/deps/poolboy/src/poolboy.erl', line: 304]}, {:poolboy, :init, 3, [file: 'c:/Coding/Projects/BoomhuisOnline/boomhuis/deps/poolboy/src/poolboy.erl', line: 153]}, {:gen_server, :init_it, 2, [file: 'gen_server.erl', line: 374]}, {:gen_server, :init_it, 6, [file: 'gen_server.erl', line: 342]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 249]}]}}

Any help/advice will be greatly appreciated!任何帮助/建议将不胜感激!

The match failure is induced (although it is worth to report to the Wallaby project because they should not blow up when the process cannot start due to port access issues,) the real cause is the process cannot open the port here:导致匹配失败(尽管值得向Wallaby项目报告,因为它们不应该在进程由于端口访问问题而无法启动时炸毁),真正的原因是进程无法在此处打开端口:

(stop) :eacces
    erlang.erl:2213: :erlang.open_port({:spawn_executable,
      'C:\\Users\\SARELV~1\\AppData\\Local\\Temp/kz9cgp/wrapper'}, ...)

The port in question is port_number: 55182 .有问题的端口是port_number: 55182 I am not familiar with Windows, but this probably means that either PhantomJS has issues opening this port or Wallaby connecting to it.我不熟悉 Windows,但这可能意味着PhantomJS在打开此端口或Wallaby连接到它时遇到问题。 Does Windows limits access to ports for regular users? Windows 是否限制普通用户访问端口? You might need to explicitly allow this somewhere in the OS settings, or like.您可能需要在操作系统设置中的某个地方明确允许这样做,或者类似的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM