diff options
author | Sverker Eriksson <sverker@erlang.org> | 2013-12-02 18:49:55 +0100 |
---|---|---|
committer | Sverker Eriksson <sverker@erlang.org> | 2013-12-02 18:49:55 +0100 |
commit | 200886ab7d03572cfc3e5ff2d686eff2010363c5 (patch) | |
tree | 87ad4dd294e9f42b709298c76b34e5559b42780c /erts/emulator/test | |
parent | 301a7c2de81559fce4ab504afe5db68744a7c6d7 (diff) | |
download | otp-200886ab7d03572cfc3e5ff2d686eff2010363c5.tar.gz otp-200886ab7d03572cfc3e5ff2d686eff2010363c5.tar.bz2 otp-200886ab7d03572cfc3e5ff2d686eff2010363c5.zip |
erts: Reduce wasted execution time for match_spec_SUITE:otp_9422
Diffstat (limited to 'erts/emulator/test')
-rw-r--r-- | erts/emulator/test/match_spec_SUITE.erl | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/erts/emulator/test/match_spec_SUITE.erl b/erts/emulator/test/match_spec_SUITE.erl index b56b7ce525..bcc46d78ba 100644 --- a/erts/emulator/test/match_spec_SUITE.erl +++ b/erts/emulator/test/match_spec_SUITE.erl @@ -213,7 +213,7 @@ test_3(Config) when is_list(Config) -> otp_9422(doc) -> []; otp_9422(Config) when is_list(Config) -> - Laps = 1000, + Laps = 10000, ?line Fun1 = fun() -> otp_9422_tracee() end, ?line P1 = spawn_link(?MODULE, loop_runner, [self(), Fun1, Laps]), io:format("spawned ~p as tracee\n", [P1]), @@ -230,7 +230,7 @@ otp_9422(Config) when is_list(Config) -> %%receive after 10*1000 -> ok end, stop_collect(P1), - stop_collect(P2), + stop_collect(P2, abort), ok. otp_9422_tracee() -> @@ -975,7 +975,9 @@ start_collect(P) -> P ! {go, self()}. stop_collect(P) -> - P ! {done, self()}, + stop_collect(P, done). +stop_collect(P, Order) -> + P ! {Order, self()}, receive {gone, P} -> ok @@ -1008,7 +1010,13 @@ loop_runner_cont(_Collector, _Fun, Laps, Laps) -> end; loop_runner_cont(Collector, Fun, N, Laps) -> Fun(), - loop_runner_cont(Collector, Fun, N+1, Laps). + receive + {abort, Collector} -> + io:format("loop_runner ~p aborted after ~p of ~p laps\n", [self(), N+1, Laps]), + Collector ! {gone, self()} + after 0 -> + loop_runner_cont(Collector, Fun, N+1, Laps) + end. f1(X) -> |