diff --git a/src/mod/endpoints/mod_sofia/test/sipp-based-tests.c b/src/mod/endpoints/mod_sofia/test/sipp-based-tests.c index 33259f043f..52c7c2f66c 100644 --- a/src/mod/endpoints/mod_sofia/test/sipp-based-tests.c +++ b/src/mod/endpoints/mod_sofia/test/sipp-based-tests.c @@ -247,6 +247,7 @@ FST_CORE_EX_BEGIN("./conf-sipp", SCF_VG | SCF_USE_SQL) FST_TEARDOWN_BEGIN() { + switch_sleep(200 * 1000); } FST_TEARDOWN_END() @@ -681,15 +682,14 @@ skiptest: fst_check(status == SWITCH_STATUS_SUCCESS); /*test is considered PASSED if we get a session*/ - if (!session) { - fst_requires(session); + fst_check(session); + if (session) { + switch_sleep(1000 * 1000); + channel = switch_core_session_get_channel(session); + switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING); + switch_core_session_rwunlock(session); } - switch_sleep(1000 * 1000); - - channel = switch_core_session_get_channel(session); - switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING); - switch_core_session_rwunlock(session); switch_safe_free(to); /* sipp should timeout, attempt kill, just in case.*/ kill_sipp(); diff --git a/src/mod/endpoints/mod_sofia/test/test_sofia_funcs.c b/src/mod/endpoints/mod_sofia/test/test_sofia_funcs.c index 7ea194f6e4..dbc75390d4 100644 --- a/src/mod/endpoints/mod_sofia/test/test_sofia_funcs.c +++ b/src/mod/endpoints/mod_sofia/test/test_sofia_funcs.c @@ -34,6 +34,7 @@ #include "../mod_sofia.c" static int timeout_sec = 10; +static switch_interval_time_t delay_start_ms = 5000; FST_CORE_EX_BEGIN("./conf", SCF_VG | SCF_USE_SQL) @@ -41,6 +42,11 @@ FST_MODULE_BEGIN(mod_sofia, sofia) FST_SETUP_BEGIN() { + /* Give mod_sofia time to spinup profile threads */ + if (delay_start_ms) { + switch_sleep(delay_start_ms * 1000); + delay_start_ms = 0; + } } FST_SETUP_END() @@ -108,7 +114,6 @@ FST_TEST_BEGIN(originate_test) fst_check(status == SWITCH_STATUS_SUCCESS); if (session) { channel = switch_core_session_get_channel(session); - fst_requires(channel); switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING); switch_core_session_rwunlock(session); switch_sleep(1 * 1000 * 1000);