laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43314?usp=email )

Change subject: Fix possible race conditions in RemsimServer_Tests
......................................................................

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 quite 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 acknowledgment 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(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved




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 https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43314?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: If5ec1ecd5689414252a73a2787e10495e23e4d30
Gerrit-Change-Number: 43314
Gerrit-PatchSet: 3
Gerrit-Owner: jolly <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: lynxis lazus <[email protected]>

Reply via email to