From 861bad759d9520b5f97be4d3c8dbb91eea86a964 Mon Sep 17 00:00:00 2001 From: peusterm Date: Thu, 18 May 2017 14:55:27 +0200 Subject: [PATCH] Try to avoid race condition problems in unittests --- src/emuvim/test/api_base_openstack.py | 3 +++ src/emuvim/test/unittests/test_openstack.py | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) 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->>>>>>>>>>>>>>>') -- 2.25.1