Commit 2283feae authored by Jérome Perrin's avatar Jérome Perrin

test_result: try fixing test_04c_startTestSuiteOrderWithManyTestNodes random failure

This test uses pinDateTime to create an history of test results where tests
have been executed in order test suite 1, 2, 3.
This is done using this pattern:

      now = DateTime()
      ... # do several things that may actually take more than one second
      self.processTest("test suite 1", "r0=a", node_title="COMP0-Node1")
      self.pinDateTime(now + 1.0/86400)
      self.processTest("test suite 2", "r0=a", node_title="COMP1-Node1")
      self.pinDateTime(now + 2.0/86400)
      self.processTest("test suite 3", "r0=a", node_title="COMP1-Node1")

My guess is that we take "now" too early, and when we add 1 second to this
now variable, this may actually be going back in time sometimes, effectively
creating test suite 2 before test suite 1.

Assign now to current date after doing all the affectTestSuite calls should
solve this.
parent 425700d0
Pipeline #11633 failed with stage
......@@ -409,7 +409,6 @@ class TestTaskDistribution(TaskDistributionTestCase):
config_list = json.loads(self.distributor.startTestSuite(
title=title))
return ["%s" % x["test_suite_title"] for x in config_list]
now = DateTime()
def affectTestSuite(node_title, test_suite_list):
test_node, = self.test_node_module.searchFolder(title=node_title)
test_node = test_node.getObject()
......@@ -430,6 +429,7 @@ class TestTaskDistribution(TaskDistributionTestCase):
affectTestSuite("COMP9-Node1", [test_suite_3])
# process some test to have old test result in database
self.processTest("test suite 1", "r0=a", node_title="COMP0-Node1")
now = DateTime()
self.pinDateTime(now + 1.0/86400)
self.processTest("test suite 2", "r0=a", node_title="COMP1-Node1")
self.pinDateTime(now + 2.0/86400)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment