File 2902-erts-Fix-port_bif_SUITE-busy_opts-with-large-pipe-si.patch of Package erlang
From 76dbade7147623e18c2b27de2e6f3e5f8bbf7436 Mon Sep 17 00:00:00 2001
From: Lukas Larsson <lukas@erlang.org>
Date: Fri, 24 Apr 2020 12:25:27 +0200
Subject: [PATCH 09/14] erts: Fix port_bif_SUITE:busy_opts with large pipe size
---
erts/emulator/test/port_bif_SUITE.erl | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/erts/emulator/test/port_bif_SUITE.erl b/erts/emulator/test/port_bif_SUITE.erl
index b71f8f2715..45936cca7f 100644
--- a/erts/emulator/test/port_bif_SUITE.erl
+++ b/erts/emulator/test/port_bif_SUITE.erl
@@ -487,11 +487,16 @@ busy_options(Config) when is_list(Config) ->
process_flag(trap_exit, true),
Tester = self(),
- HejLoop = fun (Prt, _F, 1000) ->
+
+ %% We want this loop to write enough data to tirgger the busy limits,
+ %% this means that it first has to fill the pipe buffer on Linux which
+ %% can be anything from 4k to 1 MB, so we make sure to fill it with
+ %% at least 2 MB of data here.
+ HejLoop = fun (Prt, _F, N) when N > (2 bsl 20) ->
Prt;
(Prt, F, N) ->
Prt ! {Tester, {command, Data}},
- F(Prt, F, N+1)
+ F(Prt, F, N + iolist_size(Data))
end,
io:format("Test1...~n", []),
--
2.16.4