jolly has uploaded this change for review.
Fix possible race conditions in RemsimServer_Tests
Some tests sporadically fail. The slotmap is expected to be in ACTIVE
state, but it is sometimes still in the UNACKNOWLEDGED state. The log
output of osmo-remsim-server shows that the state always changes from
UNACKNOWLEDGED to ACTIVE. So there actually no failure.
It is quire likely that the state change is checked too early. The
acknowledged of the bankd seems not to be processed yet. Add a delay to
ensure that the acknowledgement has been processed before checking the
slotmap state.
Related: OS#6996
Change-Id: If5ec1ecd5689414252a73a2787e10495e23e4d30
---
M remsim/RemsimServer_Tests.ttcn
1 file changed, 15 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/14/43314/1
diff --git a/remsim/RemsimServer_Tests.ttcn b/remsim/RemsimServer_Tests.ttcn
index de2c478..2fd420e 100644
--- a/remsim/RemsimServer_Tests.ttcn
+++ b/remsim/RemsimServer_Tests.ttcn
@@ -406,6 +406,9 @@
/* 6) expect bankd to receive that mapping */
as_rspro_create_mapping(1, sm.client, sm.bank);
+ /* An immediate slotmaps check may causes a race condition. */
+ f_sleep(1.0);
+
/* 7) verify that the slotmap exists and is ACTIVE */
f_ensure_slotmap_exists_only(sm.client, sm.bank, ACTIVE);
@@ -451,6 +454,9 @@
/* 6) expect bankd to receive that mapping */
as_rspro_create_mapping(1, sm.client, sm.bank);
+ /* An immediate slotmaps check may causes a race condition. */
+ f_sleep(1.0);
+
/* 7) verify that the slotmap exists and is ACTIVE */
f_ensure_slotmap_exists_only(sm.client, sm.bank, ACTIVE);
@@ -544,6 +550,9 @@
/* expect the slotmap to be pushed to bank and ACK it */
as_rspro_create_mapping(0, sm.client, sm.bank);
+ /* An immediate slotmaps check may causes a race condition. */
+ f_sleep(1.0);
+
/* verify that the slotmap exists and is ACTIVE */
f_ensure_slotmap_exists_only(sm.client, sm.bank, ACTIVE);
@@ -595,6 +604,9 @@
/* expect the slotmap to be pushed to bank and ACK it */
as_rspro_create_mapping(0, sm.client, sm.bank);
+ /* An immediate slotmaps check may causes a race condition. */
+ f_sleep(1.0);
+
/* verify that the slotmap exists and is ACTIVE */
f_ensure_slotmap_exists_only(sm.client, sm.bank, ACTIVE);
@@ -642,6 +654,9 @@
/* expect the slotmap to be pushed to bank and ACK it */
as_rspro_create_mapping(0, sm.client, sm.bank);
+ /* An immediate slotmaps check may causes a race condition. */
+ f_sleep(1.0);
+
/* verify that the slotmap exists and is ACTIVE */
f_ensure_slotmap_exists_only(sm.client, sm.bank, ACTIVE);
}
To view, visit change 43314. To unsubscribe, or for help writing mail filters, visit settings.