LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File 0605-code_SUITE-Fix-on_load_trace_on_load-test.patch of Package erlang (Project home:Ledest:erlang:20)

From 92a4e1f61fd5313f3590e110847a4ea19e66edb4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?John=20H=C3=B6gberg?= <john@erlang.org>
Date: Mon, 18 Mar 2019 13:17:00 +0100
Subject: [PATCH 1/2] code_SUITE: Fix on_load_trace_on_load test

Modules like 'merl' and 'erl_prettypr' could be loaded during the
actual test, causing them to be traced too.
---
 lib/kernel/test/code_SUITE.erl | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/kernel/test/code_SUITE.erl b/lib/kernel/test/code_SUITE.erl
index 64e0b9d8dd..f5c1864b3e 100644
--- a/lib/kernel/test/code_SUITE.erl
+++ b/lib/kernel/test/code_SUITE.erl
@@ -1556,6 +1556,11 @@ on_load_update_code_1(3, Mod) ->
 
 %% Test -on_load while trace feature 'on_load' is enabled (OTP-14612)
 on_load_trace_on_load(Config) ->
+    %% 'on_load' enables tracing for all newly loaded modules, so we make a dry
+    %% run to ensure that ancillary modules like 'merl' won't be loaded during
+    %% the actual test.
+    on_load_update(Config),
+
     Papa = self(),
     Tracer = spawn_link(fun F() -> receive M -> Papa ! M end, F() end),
     {tracer,[]} = erlang:trace_info(self(),tracer),
-- 
2.16.4