aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test/scheduler_SUITE.erl
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2016-06-22 16:54:49 +0200
committerRickard Green <[email protected]>2016-06-27 17:02:41 +0200
commit7f951996600d1d09c8afa422beadf7bdde772471 (patch)
treedd1d64537591d99bca8f3d1064dae4c9c6826c08 /erts/emulator/test/scheduler_SUITE.erl
parente5a13ef9d2f0a95b3dffa6add628fa7ed8e0509d (diff)
downloadotp-7f951996600d1d09c8afa422beadf7bdde772471.tar.gz
otp-7f951996600d1d09c8afa422beadf7bdde772471.tar.bz2
otp-7f951996600d1d09c8afa422beadf7bdde772471.zip
Fix scheduler_SUITE:scheduler_suspend test
Diffstat (limited to 'erts/emulator/test/scheduler_SUITE.erl')
-rw-r--r--erts/emulator/test/scheduler_SUITE.erl26
1 files changed, 24 insertions, 2 deletions
diff --git a/erts/emulator/test/scheduler_SUITE.erl b/erts/emulator/test/scheduler_SUITE.erl
index 7f239f73e7..a95de609aa 100644
--- a/erts/emulator/test/scheduler_SUITE.erl
+++ b/erts/emulator/test/scheduler_SUITE.erl
@@ -1319,11 +1319,33 @@ scheduler_suspend_test(Config, Schedulers) ->
true ->
ok
end,
- erlang:system_info(schedulers_state)
+ until(fun () ->
+ {_A, B, C} = erlang:system_info(
+ schedulers_state),
+ B == C
+ end,
+ erlang:monotonic_time()
+ + erlang:convert_time_unit(1,
+ seconds,
+ native)),
+ erlang:system_info(schedulers_state)
end]),
stop_node(Node),
ok.
-
+
+until(Pred, MaxTime) ->
+ case Pred() of
+ true ->
+ true;
+ false ->
+ case erlang:monotonic_time() > MaxTime of
+ true ->
+ false;
+ false ->
+ receive after 100 -> ok end,
+ until(Pred, MaxTime)
+ end
+ end.
sst0_loop(0) ->
ok;