]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[unit-tests] fix sps-related race in the sndfile test.
authorDragos Oancea <dragos@signalwire.com>
Mon, 22 Jun 2020 19:25:48 +0000 (19:25 +0000)
committerAndrey Volk <andywolk@gmail.com>
Mon, 9 Aug 2021 15:52:49 +0000 (18:52 +0300)
src/mod/formats/mod_sndfile/test/test_sndfile.c

index e84a01b9e19637e78f2cf79036090e564245daf4..8a6d79020782703e85df669d12fd224cd763a571 100644 (file)
@@ -425,6 +425,7 @@ FST_CORE_BEGIN("test_formats_and_muxing")
                        test_params_t params[(sizeof(extensions) / sizeof(extensions[0]))] = {{ 0 }};
                        int sps_total = 10000;
                        switch_core_session_ctl(SCSC_SPS, &sps_total);
+                       switch_sleep(1000000);  // softtimer_runtime sets sps every second
 
                        SWITCH_STANDARD_STREAM(stream);
 
@@ -468,6 +469,7 @@ FST_CORE_BEGIN("test_formats_and_muxing")
                        test_params_t params[(sizeof(extensions) / sizeof(extensions[0]))] = {{ 0 }};
                        int sps_total = 10000;
                        switch_core_session_ctl(SCSC_SPS, &sps_total);
+                       switch_sleep(1000000); // softtimer_runtime sets sps every second
 
                        SWITCH_STANDARD_STREAM(stream);
 
@@ -509,7 +511,8 @@ FST_CORE_BEGIN("test_formats_and_muxing")
                        test_params_t params[(sizeof(extensions) / sizeof(extensions[0]))] = {{ 0 }};
                        int sps_total = 10000;
                        switch_core_session_ctl(SCSC_SPS, &sps_total);
-                       
+                       switch_sleep(1000000);  // softtimer_runtime sets sps every second
+
                        SWITCH_STANDARD_STREAM(stream);
 
                        switch_api_execute("sndfile_debug", "on", NULL, &stream);
@@ -552,6 +555,7 @@ FST_CORE_BEGIN("test_formats_and_muxing")
                        test_params_t params[(sizeof(extensions) / sizeof(extensions[0]))] = {{ 0 }};
                        int sps_total = 10000;
                        switch_core_session_ctl(SCSC_SPS, &sps_total);
+                       switch_sleep(1000000);  // softtimer_runtime sets sps every second
 
                        SWITCH_STANDARD_STREAM(stream);