File 7632-snmp-manager-test-Fixed-end_per_testcase-for-the-sim.patch of Package erlang
From ff9f70c3c0fe2fe2f7b4850dd5fc6602099f2e17 Mon Sep 17 00:00:00 2001
From: Micael Karlberg <bmk@erlang.org>
Date: Wed, 24 Nov 2021 11:54:33 +0100
Subject: [PATCH 2/3] [snmp|manager|test] Fixed end_per_testcase for the
simple_v3_exchange cases
The end_per_testcase was never actually (properly) done for
the simple_v3_exchange_* cases.
---
lib/snmp/test/snmp_manager_SUITE.erl | 10 ++++++++--
lib/snmp/test/snmp_test_global_sys_monitor.erl | 11 +++++++----
2 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/lib/snmp/test/snmp_manager_SUITE.erl b/lib/snmp/test/snmp_manager_SUITE.erl
index fdd58df696..9d0ca56cfd 100644
--- a/lib/snmp/test/snmp_manager_SUITE.erl
+++ b/lib/snmp/test/snmp_manager_SUITE.erl
@@ -653,7 +653,7 @@ end_per_testcase(Case, Config) when is_list(Config) ->
Conf2 = end_per_testcase2(Case, Conf1),
?IPRINT("end_per_testcase -> done with"
- "~n Condif: ~p"
+ "~n Config: ~p"
"~n Nodes: ~p", [Conf2, erlang:nodes()]),
Conf2.
diff --git a/lib/snmp/test/snmp_test_global_sys_monitor.erl b/lib/snmp/test/snmp_test_global_sys_monitor.erl
index c77b118d18..1c90fff686 100644
--- a/lib/snmp/test/snmp_test_global_sys_monitor.erl
+++ b/lib/snmp/test/snmp_test_global_sys_monitor.erl
@@ -22,7 +22,7 @@
-export([start/0, stop/0,
reset_events/0,
- events/0,
+ events/0, events/1,
log/1]).
-export([init/1]).
@@ -47,7 +47,10 @@ reset_events() ->
call(reset_events, ?TIMEOUT).
events() ->
- call(events, ?TIMEOUT).
+ events(?TIMEOUT).
+
+events(Timeout) when is_integer(Timeout) andalso (Timeout > 0) ->
+ call(events, Timeout).
log(Event) ->
cast({node(), Event}).
@@ -229,10 +232,10 @@ call(Req, Timeout) when is_integer(Timeout) ->
%% This peace of weirdness is because on some machines this call has
%% hung (in a call during end_per_testcase, which had a 1 min timeout,
%% or if that was the total time for the test case).
-%% But because it hung there, we don't really know what where it git stuck.
+%% But because it hung there, we don't really know where it got stuck.
%% So, by making the call in a tmp process, that we supervise, we can
%% keep control. Also, we change the default timeout from infinity to an
-%% actual time (16 seconds).
+%% actual time (6 seconds).
call(Req, Timeout1, Timeout2) ->
F = fun() ->
Ref = make_ref(),
--
2.31.1