diff --git a/fuel_plugin/ostf_adapter/nose_plugin/nose_adapter.py b/fuel_plugin/ostf_adapter/nose_plugin/nose_adapter.py index 32efbfc9..9d8d53a8 100644 --- a/fuel_plugin/ostf_adapter/nose_plugin/nose_adapter.py +++ b/fuel_plugin/ostf_adapter/nose_plugin/nose_adapter.py @@ -16,7 +16,6 @@ import fcntl import logging import os import signal -import time try: from oslo.config import cfg @@ -80,11 +79,6 @@ class NoseDriver(object): raise InterruptTestRunException() signal.signal(signal.SIGUSR1, raise_exception_handler) - # FIXME(dteselkin): add some sleep to allow process to - # initialize db before selecting data - # LP#1522941 - time.sleep(1) - with engine.contexted_session(dbpath) as session: testrun = session.query(models.TestRun)\ .filter_by(id=test_run_id)\ diff --git a/fuel_plugin/ostf_adapter/storage/models.py b/fuel_plugin/ostf_adapter/storage/models.py index 7a9a4106..5c86040c 100644 --- a/fuel_plugin/ostf_adapter/storage/models.py +++ b/fuel_plugin/ostf_adapter/storage/models.py @@ -309,6 +309,13 @@ class TestRun(BASE): new_test = test.copy_test(test_run, predefined_tests) session.add(new_test) test_run.tests.append(new_test) + # NOTE(akostrikov) Seems there is a problem with transaction + # isolation, so we need not only to flush, but also to commit. + # We fork and then in forks we flush sql items. But it seems that + # it happens in transaction so we are not getting in other + # processes add results. So I force transaction commit to provide + # changes to all forks os OSTF. + session.commit() session.flush() return test_run