diff options
author | Björn Gustavsson <[email protected]> | 2019-04-08 14:09:11 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2019-04-08 14:09:11 +0200 |
commit | 21f95e607ea584b84102fd45cb138277760b1c6d (patch) | |
tree | a7dbb8d9543320dbc8cf5edaa582d6495a6fd829 /lib/common_test | |
parent | f93862d2fe7e994523b1a6b2ca99635a4cf5bba3 (diff) | |
download | otp-21f95e607ea584b84102fd45cb138277760b1c6d.tar.gz otp-21f95e607ea584b84102fd45cb138277760b1c6d.tar.bz2 otp-21f95e607ea584b84102fd45cb138277760b1c6d.zip |
Clear ERL_AFLAGS when starting a previous release
When starting a slave or peer node, options in ERL_AFLAGS might not
be valid for the previous release. For instance, "-emu_type lcnt"
would only work if the previous release happened to have been built
with a lock counting emulator.
Diffstat (limited to 'lib/common_test')
-rw-r--r-- | lib/common_test/src/test_server_node.erl | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/common_test/src/test_server_node.erl b/lib/common_test/src/test_server_node.erl index 3ae4a047d8..c11b9071cf 100644 --- a/lib/common_test/src/test_server_node.erl +++ b/lib/common_test/src/test_server_node.erl @@ -598,11 +598,20 @@ pick_erl_program(L) -> {prog, S} -> S; {release, S} -> + clear_erl_aflags(), find_release(S); this -> ct:get_progname() end. +clear_erl_aflags() -> + %% When starting a node with a previous release, options in + %% ERL_AFLAGS could prevent the node from starting. For example, + %% if ERL_AFLAGS is set to "-emu_type lcnt", the node will only + %% start if the previous release happens to also have a lock + %% counter emulator installed (unlikely). + os:unsetenv("ERL_AFLAGS"). + %% This is an attempt to distinguish between spaces in the program %% path and spaces that separate arguments. The program is quoted to %% allow spaces in the path. |