<p style="white-space: pre-wrap; word-wrap: break-word;">I agree with Harald here, it would be good to find the actual problem.</p><p style="white-space: pre-wrap; word-wrap: break-word;">To me it looks like the race condition is happening in RSL_Emulation.f_chan_est(), which is called by MSC_ConnectionHandler.f_create_chan_and_exp(). In this function we basically send a ChanRqd, wait for an Immediate Assignment, and then send the ESTablish INDication. The last message is important because it triggers the SCCP connection establishment towards the virtual MSC. Most likely, the Service Reject message gets enqueued *before* the actual SCCP connection is established.</p><p style="white-space: pre-wrap; word-wrap: break-word;">I compared the following test suite logs line-by-line:</p><p style="white-space: pre-wrap; word-wrap: break-word;">[PASS] https://jenkins.osmocom.org/jenkins/view/TTCN3/job/ttcn3-bsc-test/1580/artifact/logs/bsc-tester/BSC_Tests.TC_cm_serv_rej.merged<br>[FAIL] https://jenkins.osmocom.org/jenkins/view/TTCN3/job/ttcn3-bsc-test/1581/artifact/logs/bsc-tester/BSC_Tests.TC_cm_serv_rej.merged</p><p style="white-space: pre-wrap; word-wrap: break-word;">and indeed, during the successful run we first get a 'SCCPasp_Types.ASP_SCCP_N_CONNECT_ind', and then enqueue a 'BSSAP_Types.PDU_BSSAP' with the reject. The logs of the failed run indicate that we get a 'BSSAP_Types.PDU_BSSAP' before the 'SCCPasp_Types.ASP_SCCP_N_CONNECT_ind'.</p><p style="white-space: pre-wrap; word-wrap: break-word;">My proposal is to modify f_create_chan_and_exp() in a way that it would block until the SCCP connection is established.</p><p>Patch set 1:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #ffd4d4;">Code-Review -2</span></p><p><a href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/26433">View Change</a></p><ul style="list-style: none; padding: 0;"></ul><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/26433">change 26433</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/26433"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-ttcn3-hacks </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Iad30319a7e9e726d006c9934ed2eb48f886811a9 </div>
<div style="display:none"> Gerrit-Change-Number: 26433 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Comment-Date: Sat, 04 Dec 2021 16:31:58 +0000 </div>
<div style="display:none"> Gerrit-HasComments: No </div>
<div style="display:none"> Gerrit-Has-Labels: Yes </div>
<div style="display:none"> Gerrit-MessageType: comment </div>