<p>Jenkins2 <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/9199">View Change</a></p><div style="white-space:pre-wrap">Approvals:
George Joseph: Looks good to me, but someone else must approve
Joshua Colp: Looks good to me, approved
Jenkins2: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_pjsip_pubsub/exten_state: state changes sometimes initiated too soon<br><br>There is a race condition in the test where the state changes could be triggered<br>before the subscription was finalized. If this happened then the test would time<br>out and fail due to not receiving the expected NOTIFY's.<br><br>This patch ensures that the test does not trigger the state changes until the<br>subscription has been fully established.<br><br>ASTERISK-27765 #close<br><br>Change-Id: I3ae529d475a8b148eb06b536d9f37d4778b40c52<br>---<br>M tests/channels/pjsip/subscriptions/presence/presencestate_repeat_okay/repeat_presence_state.py<br>1 file changed, 5 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/tests/channels/pjsip/subscriptions/presence/presencestate_repeat_okay/repeat_presence_state.py b/tests/channels/pjsip/subscriptions/presence/presencestate_repeat_okay/repeat_presence_state.py<br>index 917be67..172ca45 100644<br>--- a/tests/channels/pjsip/subscriptions/presence/presencestate_repeat_okay/repeat_presence_state.py<br>+++ b/tests/channels/pjsip/subscriptions/presence/presencestate_repeat_okay/repeat_presence_state.py<br>@@ -26,14 +26,17 @@<br> 'Value': INIT_STATE<br> }<br> test_object.register_ami_observer(self.ami_connect)<br>- test_object.register_scenario_started_observer(self.scenario_started)<br> <br> def ami_connect(self, ami):<br> self.ami = ami<br>+ self.ami.registerEvent('TestEvent', self.handle_sub_established)<br> # Set initial presence state<br> self.ami.sendMessage(self.ami_message)<br> <br>- def scenario_started(self, scenario):<br>+ def handle_sub_established(self, ami, event):<br>+ if event['state'] != 'SUBSCRIPTION_ESTABLISHED':<br>+ return<br>+<br> # Set new presence subvalues. These should result in SIP NOTIFYs<br> self.ami_message['Value'] = NEW_SUBTYPE<br> self.ami.sendMessage(self.ami_message)<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/9199">change 9199</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.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.asterisk.org/9199"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: testsuite </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I3ae529d475a8b148eb06b536d9f37d4778b40c52 </div>
<div style="display:none"> Gerrit-Change-Number: 9199 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>