diff options
author | Peter Andersson <[email protected]> | 2012-03-13 10:54:01 +0100 |
---|---|---|
committer | Peter Andersson <[email protected]> | 2012-03-13 10:54:17 +0100 |
commit | 774be3d0e3cf19f877bf00c3adb7f2389cc0dc37 (patch) | |
tree | 2da625cb9795ef638e8652567d48ce02d3bae290 /lib | |
parent | 4e73ac6e7339e965c17ad732350275b5650ce5c4 (diff) | |
parent | 91f60211efb41d935269edfad7a9c0312b8011d0 (diff) | |
download | otp-774be3d0e3cf19f877bf00c3adb7f2389cc0dc37.tar.gz otp-774be3d0e3cf19f877bf00c3adb7f2389cc0dc37.tar.bz2 otp-774be3d0e3cf19f877bf00c3adb7f2389cc0dc37.zip |
Merge remote branch 'origin/peppe/common_test/otp-9830' into maint
* origin/peppe/common_test/otp-9830:
Fix problem with buffered DOWN messages
OTP-9830
Diffstat (limited to 'lib')
-rw-r--r-- | lib/common_test/src/ct.erl | 2 | ||||
-rw-r--r-- | lib/common_test/src/ct_util.erl | 23 |
2 files changed, 16 insertions, 9 deletions
diff --git a/lib/common_test/src/ct.erl b/lib/common_test/src/ct.erl index 00701f5a2d..0a77527b2f 100644 --- a/lib/common_test/src/ct.erl +++ b/lib/common_test/src/ct.erl @@ -861,6 +861,8 @@ get_status() -> get_testdata(Key) -> case catch ct_util:get_testdata(Key) of + {error,ct_util_server_not_running} -> + no_tests_running; Error = {error,_Reason} -> Error; {'EXIT',_Reason} -> diff --git a/lib/common_test/src/ct_util.erl b/lib/common_test/src/ct_util.erl index 3b6ad6f98d..e9bfb2590b 100644 --- a/lib/common_test/src/ct_util.erl +++ b/lib/common_test/src/ct_util.erl @@ -827,15 +827,20 @@ get_profile_data(Profile, Key, StartDir) -> %%%----------------------------------------------------------------- %%% Internal functions call(Msg) -> - MRef = erlang:monitor(process,whereis(ct_util_server)), - Ref = make_ref(), - ct_util_server ! {Msg,{self(),Ref}}, - receive - {Ref, Result} -> - erlang:demonitor(MRef, [flush]), - Result; - {'DOWN',MRef,process,_,Reason} -> - {error,{ct_util_server_down,Reason}} + case whereis(ct_util_server) of + undefined -> + {error,ct_util_server_not_running}; + Pid -> + MRef = erlang:monitor(process, Pid), + Ref = make_ref(), + ct_util_server ! {Msg,{self(),Ref}}, + receive + {Ref, Result} -> + erlang:demonitor(MRef, [flush]), + Result; + {'DOWN',MRef,process,_,Reason} -> + {error,{ct_util_server_down,Reason}} + end end. return({To,Ref},Result) -> |