From 491af2a33e1a3e4719d0116326c98ae14ee60c93 Mon Sep 17 00:00:00 2001 From: Daniel Willmann Date: Fri, 8 Jan 2021 01:32:51 +0100 Subject: [PATCH] Fix race during shutdown To avoid a dynamic test case error we need to prevent messages arriving on unconnected ports. Waiting some time before stopping components ensures that any messages "in flight" will be delivered to the port before the component is shutdown and disconnected. It would be far nicer to mark a testresult "final" and ignore such errors on shutdown, but I don't think it's possible in TTCN3. This fixes TC_fc_bvc on my laptop which consistently failed with a DTE before. Change-Id: I98928f24745125642225681d13bf2e78691e9747 Related: SYS#5115, OS#4518 --- gbproxy/GBProxy_Tests.ttcn | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gbproxy/GBProxy_Tests.ttcn b/gbproxy/GBProxy_Tests.ttcn index 00f6e2efd..62daaf41d 100644 --- a/gbproxy/GBProxy_Tests.ttcn +++ b/gbproxy/GBProxy_Tests.ttcn @@ -526,6 +526,11 @@ function f_init(float t_guard := 30.0) runs on test_CT { function f_cleanup() runs on test_CT { var integer i; + /* To avoid a dynamic test case error we need to prevent messages arriving on unconnected + * ports. Waiting here ensures that any messages "in flight" will be delivered to the port + * before the component is shutdown and disconnected. */ + f_sleep(0.2); + for (i := 0; i < lengthof(mp_nsconfig_sgsn); i := i+1) { f_destroy_gb(g_sgsn[i]); }