diff options
author | Lukas Larsson <lukas@erlang.org> | 2022-10-25 13:24:09 +0200 |
---|---|---|
committer | Lukas Larsson <lukas@erlang.org> | 2022-10-25 13:24:09 +0200 |
commit | af09a5f3bdc2ee872545313f45e7c6ad2bb6b0a7 (patch) | |
tree | 0073061ab6a742abb467ecc1d030d1a457808fc1 /lib/stdlib/test | |
parent | 915f5f585dcd170409a92bd035b1745f7c2803bb (diff) | |
parent | e0d6fc0d898dd94c21e2c56793dcd1ad2f34ad38 (diff) | |
download | erlang-af09a5f3bdc2ee872545313f45e7c6ad2bb6b0a7.tar.gz |
Merge branch 'lukas/25/test-fixes' into maint
* lukas/25/test-fixes:
peer: Increase accept timeout
peer: Fix ssh testcase on windows
sendfile: Expand sleep to allow send to start
kernel|erts: Use memavailable for tests when available
kernel: Run large_file tests in a peer node
logger: Adjust sync testcase timeout
lcnt: Filter out crypto mutexes from tests
kernel: Fix latin1 filename testcases on zfs utf8only
erts: Add extra sync in dump_SUITE
Diffstat (limited to 'lib/stdlib/test')
-rw-r--r-- | lib/stdlib/test/peer_SUITE.erl | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/stdlib/test/peer_SUITE.erl b/lib/stdlib/test/peer_SUITE.erl index 9db03fe596..e5372416ee 100644 --- a/lib/stdlib/test/peer_SUITE.erl +++ b/lib/stdlib/test/peer_SUITE.erl @@ -518,8 +518,20 @@ ssh(Config) when is_list(Config) -> {skip, "erl not found"}; {ErlPath, SshPath} -> Name = peer:random_name(?FUNCTION_NAME), - {ok, Peer, _Node} = peer:start_link(#{exec => {SshPath, ["localhost", ErlPath]}, - connection => standard_io, name => Name, host => "localhost"}), + {OsName, _} = os:type(), + Options = #{exec => {SshPath, ["localhost", ErlPath]}, + connection => standard_io, name => Name, host => "localhost"}, + {ok, Peer, _Node} = + try peer:start_link(Options) of + Result -> Result + catch error:{boot_failed, normal} when OsName =:= win32 -> + %% If the boot fails on windows, ssh may have ended up + %% in wsl, so we try to boot using a wsl path + WslPath = string:trim(os:cmd("wsl wslpath -u " ++ ErlPath)), + peer:start_link( + Options#{ exec => {SshPath, ["localhost", WslPath]}}) + end, + %% TODO: how to check it really goes over SSH? %% ssh-ed node is not distributed ?assertEqual(list_to_atom(Name ++ "@localhost"), peer:call(Peer, erlang, node, [])), |