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
This commit is contained in:
Daniel Willmann 2021-01-08 01:32:51 +01:00 committed by laforge
parent 2889f87d20
commit 491af2a33e
1 changed files with 5 additions and 0 deletions

View File

@ -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]);
}