Bladeren bron

Changed tests cleanup timing

Paul-Louis Ageneau 4 jaren geleden
bovenliggende
commit
64a5d6ecb0
7 gewijzigde bestanden met toevoegingen van 10 en 6 verwijderingen
  1. 1 1
      test/benchmark.cpp
  2. 1 1
      test/capi_connectivity.cpp
  3. 1 1
      test/capi_track.cpp
  4. 1 1
      test/connectivity.cpp
  5. 4 0
      test/main.cpp
  6. 1 1
      test/track.cpp
  7. 1 1
      test/websocket.cpp

+ 1 - 1
test/benchmark.cpp

@@ -169,9 +169,9 @@ size_t benchmark(milliseconds duration) {
 
 	pc1->close();
 	pc2->close();
-	this_thread::sleep_for(1s);
 
 	rtc::Cleanup();
+	this_thread::sleep_for(1s);
 	return goodput;
 }
 

+ 1 - 1
test/capi_connectivity.cpp

@@ -270,7 +270,7 @@ int test_capi_connectivity_main() {
 
 	// You may call rtcCleanup() when finished to free static resources
 	rtcCleanup();
-	sleep(2);
+	sleep(1);
 
 	printf("Success\n");
 	return 0;

+ 1 - 1
test/capi_track.cpp

@@ -179,7 +179,7 @@ int test_capi_track_main() {
 
 	// You may call rtcCleanup() when finished to free static resources
 	rtcCleanup();
-	sleep(2);
+	sleep(1);
 
 	printf("Success\n");
 	return 0;

+ 1 - 1
test/connectivity.cpp

@@ -247,7 +247,7 @@ void test_connectivity() {
 
 	// You may call rtc::Cleanup() when finished to free static resources
 	rtc::Cleanup();
-	this_thread::sleep_for(2s);
+	this_thread::sleep_for(1s);
 
 	cout << "Success" << endl;
 }

+ 4 - 0
test/main.cpp

@@ -50,6 +50,7 @@ int main(int argc, char **argv) {
 		cerr << "WebRTC connectivity test failed: " << e.what() << endl;
 		return -1;
 	}
+	this_thread::sleep_for(1s);
 	try {
 		cout << endl << "*** Running WebRTC C API connectivity test..." << endl;
 		test_capi_connectivity();
@@ -59,6 +60,7 @@ int main(int argc, char **argv) {
 		return -1;
 	}
 #if RTC_ENABLE_MEDIA
+	this_thread::sleep_for(1s);
 	try {
 		cout << endl << "*** Running WebRTC Track test..." << endl;
 		test_track();
@@ -77,6 +79,7 @@ int main(int argc, char **argv) {
 	}
 #endif
 #if RTC_ENABLE_WEBSOCKET
+	this_thread::sleep_for(1s);
 	try {
 		cout << endl << "*** Running WebSocket test..." << endl;
 		test_websocket();
@@ -86,6 +89,7 @@ int main(int argc, char **argv) {
 		return -1;
 	}
 #endif
+	this_thread::sleep_for(1s);
 	try {
 		cout << endl << "*** Running WebRTC benchmark..." << endl;
 		test_benchmark();

+ 1 - 1
test/track.cpp

@@ -145,7 +145,7 @@ void test_track() {
 
 	// You may call rtc::Cleanup() when finished to free static resources
 	rtc::Cleanup();
-	this_thread::sleep_for(2s);
+	this_thread::sleep_for(1s);
 
 	cout << "Success" << endl;
 }

+ 1 - 1
test/websocket.cpp

@@ -76,7 +76,7 @@ void test_websocket() {
 		throw runtime_error("Expected message not received");
 
 	ws->close();
-	this_thread::sleep_for(2s);
+	this_thread::sleep_for(1s);
 
 	// You may call rtc::Cleanup() when finished to free static resources
 	rtc::Cleanup();