Use threading instead of eventlet in race condition tests
Change-Id: Ica1da69f6acc67849d50b099a80508b7aa243c33 Signed-off-by: Arnaud M <arnaud.morin@gmail.com>
This commit is contained in:
@@ -12,10 +12,9 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from eventlet import corolocal
|
|
||||||
from eventlet import semaphore
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
import testtools
|
import testtools
|
||||||
|
import threading
|
||||||
|
|
||||||
from mistral.db.v2 import api as db_api
|
from mistral.db.v2 import api as db_api
|
||||||
from mistral.services import workflows as wf_service
|
from mistral.services import workflows as wf_service
|
||||||
@@ -103,7 +102,7 @@ class BlockingAction(actions_base.Action):
|
|||||||
self.unblock_test()
|
self.unblock_test()
|
||||||
self.wait_for_test()
|
self.wait_for_test()
|
||||||
|
|
||||||
print('Action completed [eventlet_id=%s]' % corolocal.get_ident())
|
print('Action completed [thread_id=%s]' % threading.get_ident())
|
||||||
|
|
||||||
return 'test'
|
return 'test'
|
||||||
|
|
||||||
@@ -118,8 +117,8 @@ class EngineActionRaceConditionTest(base.EngineTestCase):
|
|||||||
global ACTION_SEMAPHORE
|
global ACTION_SEMAPHORE
|
||||||
global TEST_SEMAPHORE
|
global TEST_SEMAPHORE
|
||||||
|
|
||||||
ACTION_SEMAPHORE = semaphore.Semaphore(1)
|
ACTION_SEMAPHORE = threading.Semaphore(1)
|
||||||
TEST_SEMAPHORE = semaphore.Semaphore(0)
|
TEST_SEMAPHORE = threading.Semaphore(0)
|
||||||
|
|
||||||
self.register_action_class('test.block', BlockingAction)
|
self.register_action_class('test.block', BlockingAction)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user