簡體   English   中英

Elixir 小袋鼠在混合測試中崩潰

[英]Elixir Wallaby crashes on mix test

我正在嘗試將 Wallaby 合並到我的 phoenix 應用程序中。 我已密切遵循設置指南並確保正確安裝了 phantomjs,但是在混合測試中我收到以下錯誤:

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

我的操作系統是Windows10。 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]}]}}

任何幫助/建議將不勝感激!

導致匹配失敗(盡管值得向Wallaby項目報告,因為它們不應該在進程由於端口訪問問題而無法啟動時炸毀),真正的原因是進程無法在此處打開端口:

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

有問題的端口是port_number: 55182 我不熟悉 Windows,但這可能意味着PhantomJS在打開此端口或Wallaby連接到它時遇到問題。 Windows 是否限制普通用戶訪問端口? 您可能需要在操作系統設置中的某個地方明確允許這樣做,或者類似的。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM