@@ -670,14 +670,11 @@ ping_timeout(Config) ->
670670 escalus_session :session (escalus_session :bind (NewUser )),
671671 send_initial_presence (NewUser ),
672672
673- % % %% Check if the error stanza was handled by mod_ping.
673+ % % Check if the error stanza was handled by mod_ping.
674674 % % There is a slight chance of more than one error stanza,
675675 % % so the processing happens in lists:foreach.
676- lists :foreach (fun (Stanza ) ->
677- escalus :assert (is_iq_error , Stanza ),
678- ? assertNotEqual (undefined ,
679- exml_query :subelement_with_name_and_ns (Stanza , <<" ping" >>, <<" urn:xmpp:ping" >>))
680- end , get_stanzas_filtered_by_mod_ping ()),
676+
677+ check_stanzas_filtered_by_mod_ping (),
681678
682679 % % stop the connection
683680 escalus_connection :stop (NewUser ).
@@ -1406,6 +1403,15 @@ get_stanzas_filtered_by_mod_ping() ->
14061403 {stop , drop } = _Result
14071404 } <- History
14081405 ].
1406+
1407+ check_stanzas_filtered_by_mod_ping () ->
1408+ Stanzas = get_stanzas_filtered_by_mod_ping (),
1409+ lists :foreach (fun (Stanza ) ->
1410+ escalus :assert (is_iq_error , Stanza ),
1411+ ? assertNotEqual (undefined ,
1412+ exml_query :subelement_with_name_and_ns (Stanza , <<" ping" >>, <<" urn:xmpp:ping" >>))
1413+ end , Stanzas ),
1414+ ? assert (length (Stanzas ) > 0 ).
14091415% %--------------------------------------------------------------------
14101416% % IQ handler necessary for reproducing "replies_are_processed_by_resumed_session"
14111417% %--------------------------------------------------------------------
0 commit comments