diff options
author | Sverker Eriksson <[email protected]> | 2013-12-03 10:52:04 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2013-12-03 10:52:04 +0100 |
commit | 342d12087e62ffaf239a3a42d503d9e5ec64a83f (patch) | |
tree | b86183350dd0170781d15e75e1ebc3309759f0fa /erts/emulator/test/match_spec_SUITE.erl | |
parent | 7d7861ca7bdf9076b64f166d0331b0890c03c159 (diff) | |
parent | 200886ab7d03572cfc3e5ff2d686eff2010363c5 (diff) | |
download | otp-342d12087e62ffaf239a3a42d503d9e5ec64a83f.tar.gz otp-342d12087e62ffaf239a3a42d503d9e5ec64a83f.tar.bz2 otp-342d12087e62ffaf239a3a42d503d9e5ec64a83f.zip |
Merge branch 'sverk/test-cuddle' into maint
* sverk/test-cuddle:
erts: Reduce wasted execution time for match_spec_SUITE:otp_9422
Diffstat (limited to 'erts/emulator/test/match_spec_SUITE.erl')
-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) -> |