aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test/scheduler_SUITE.erl
diff options
context:
space:
mode:
authorJohn Högberg <[email protected]>2018-07-19 11:41:06 +0200
committerJohn Högberg <[email protected]>2018-09-13 09:02:40 +0200
commit6f5a0d5f83668d4b53fcce9a6c927e30df169765 (patch)
treef3ce8ad3ae1382c6e7723c039bb4ec7b1a1edb82 /erts/emulator/test/scheduler_SUITE.erl
parentffa54a25e1cc9c6d0b93dcd3a84ae9c8962ff7ec (diff)
downloadotp-6f5a0d5f83668d4b53fcce9a6c927e30df169765.tar.gz
otp-6f5a0d5f83668d4b53fcce9a6c927e30df169765.tar.bz2
otp-6f5a0d5f83668d4b53fcce9a6c927e30df169765.zip
Improve trapping in lists:reverse/2
If the process had more free space than reductions it could run a lot longer than it was supposed to. It didn't honor the number of reductions going in either, nor did it bump reductions when returning its result or erroring out. This commit also removes this function from a work function in scheduler_SUITE as it's extremely sensitive to the number of reductions spent in the test, causing equal_and_high_with_part_time_max to fail on some machines.
Diffstat (limited to 'erts/emulator/test/scheduler_SUITE.erl')
-rw-r--r--erts/emulator/test/scheduler_SUITE.erl4
1 files changed, 3 insertions, 1 deletions
diff --git a/erts/emulator/test/scheduler_SUITE.erl b/erts/emulator/test/scheduler_SUITE.erl
index 7eebbe8b19..d98edd1ec2 100644
--- a/erts/emulator/test/scheduler_SUITE.erl
+++ b/erts/emulator/test/scheduler_SUITE.erl
@@ -2155,7 +2155,7 @@ workers_exit([Ps|Pss]) ->
workers_exit(Pss).
do_work(PartTime) ->
- lists:reverse(lists:seq(1, 50)),
+ _ = id(lists:seq(1, 50)),
receive stop_work -> receive after infinity -> ok end after 0 -> ok end,
case PartTime of
true -> receive after 1 -> ok end;
@@ -2163,6 +2163,8 @@ do_work(PartTime) ->
end,
do_work(PartTime).
+id(I) -> I.
+
workers(N, _Prio, _PartTime) when N =< 0 ->
[];
workers(N, Prio, PartTime) ->