Try to avoid race condition problems in unittests
authorpeusterm <manuel.peuster@uni-paderborn.de>
Thu, 18 May 2017 12:55:27 +0000 (14:55 +0200)
committerpeusterm <manuel.peuster@uni-paderborn.de>
Thu, 18 May 2017 12:55:27 +0000 (14:55 +0200)
src/emuvim/test/api_base_openstack.py
src/emuvim/test/unittests/test_openstack.py

index c62f80f..6fb9b49 100755 (executable)
@@ -34,6 +34,7 @@ import unittest
 import os
 import subprocess
 import docker
+import time
 from emuvim.dcemulator.net import DCNetwork
 from emuvim.api.openstack.openstack_api_endpoint import OpenstackApiEndpoint
 from mininet.clean import cleanup
@@ -136,6 +137,7 @@ class ApiBaseOpenStack(unittest.TestCase):
 
 
     def tearDown(self):
+        time.sleep(2)
         print('->>>>>>> tear everything down ->>>>>>>>>>>>>>>')
         self.stopApi() # stop all flask threads
         self.stopNet() # stop some mininet and containernet stuff
@@ -153,6 +155,7 @@ class ApiBaseOpenStack(unittest.TestCase):
                 stdout=devnull,
                 stderr=devnull,
                 shell=True)
+        time.sleep(2)
 
 
 
index 707b999..cb4fb03 100755 (executable)
@@ -34,6 +34,7 @@ import os
 import unittest
 import requests
 import simplejson as json
+import time
 
 from emuvim.test.api_base_openstack import ApiBaseOpenStack
 
@@ -54,10 +55,12 @@ class testRestApi(ApiBaseOpenStack):
 
         # start api
         self.startApi()
+        time.sleep(2)
 
         # start Mininet network
         self.startNet()
-
+        time.sleep(2)
+        
     @unittest.skip("temporarily disabled")
     def testChainingDummy(self):
         print('->>>>>>> test Chaining Class->>>>>>>>>>>>>>>')