From: peusterm Date: Thu, 18 May 2017 12:55:27 +0000 (+0200) Subject: Try to avoid race condition problems in unittests X-Git-Tag: v3.1~27^2~1 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=861bad759d9520b5f97be4d3c8dbb91eea86a964;p=osm%2Fvim-emu.git Try to avoid race condition problems in unittests --- diff --git a/src/emuvim/test/api_base_openstack.py b/src/emuvim/test/api_base_openstack.py index c62f80f..6fb9b49 100755 --- a/src/emuvim/test/api_base_openstack.py +++ b/src/emuvim/test/api_base_openstack.py @@ -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) diff --git a/src/emuvim/test/unittests/test_openstack.py b/src/emuvim/test/unittests/test_openstack.py index 707b999..cb4fb03 100755 --- a/src/emuvim/test/unittests/test_openstack.py +++ b/src/emuvim/test/unittests/test_openstack.py @@ -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->>>>>>>>>>>>>>>')