Skip to contentSkip to conversation

selftest/tinfoil: fix a race condition

PATCH In review Alexander Kanavin 2 participants 3 messages Feb 29, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftest/tinfoil: fix a race condition

Both test_parse_recipe_initial_datastore and the preceding test operate on the same recipe, and both change recipe metadata and re-parse it. In some situations bitbake backend from the first test is catching the change done by the second test and interprets it as non-deterministic metadata (not sure if this sentence is entirely technically correct though :).

The easiest way to avoid is to make the tests operate on two different recipes.

[YOCTO #13812]

---
 meta/lib/oeqa/selftest/cases/tinfoil.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/lib/oeqa/selftest/cases/tinfoil.py +1 -1
index 42a1b6b4f4..1bbb7eeec7 100644
@@ -68,7 +68,7 @@ class TinfoilTests(OESelftestTestCase):
     def test_parse_recipe_initial_datastore(self):
         with bb.tinfoil.Tinfoil() as tinfoil:
             tinfoil.prepare(config_only=False, quiet=2)
-            testrecipe = 'mdadm'
+            testrecipe = 'psplash'
             best = tinfoil.find_best_provider(testrecipe)
             if not best:
                 self.fail('Unable to find recipe providing %s' % testrecipe)
Signature · 1 line
2.25.1
#1 lore raw
Quoted 8 lines · Alexander Kanavin

Both test_parse_recipe_initial_datastore and the preceding test operate on the same recipe, and both change recipe metadata and re- parse
it. In some situations bitbake backend from the first test is catching the change done by the second test and interprets it as non-deterministic metadata (not sure if this sentence is entirely technically correct though :).

Quoted 4 lines

The easiest way to avoid is to make the tests operate on two different recipes.

[YOCTO #13812]

I'm not sure its this simple unfortunately.

The big question is whether injected changes from the first "session" should persist into the second "session" or whether things should be reset to a consistent state between them.

Yes, this will fix the test but I'm not sure its fixing the underlying problem :(

Cheers,

Richard

Quoted 23 lines
---
 meta/lib/oeqa/selftest/cases/tinfoil.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/lib/oeqa/selftest/cases/tinfoil.py +1 -1
index 42a1b6b4f4..1bbb7eeec7 100644
@@ -68,7 +68,7 @@ class TinfoilTests(OESelftestTestCase):
     def test_parse_recipe_initial_datastore(self):
         with bb.tinfoil.Tinfoil() as tinfoil:
             tinfoil.prepare(config_only=False, quiet=2)
-            testrecipe = 'mdadm'
+            testrecipe = 'psplash'
             best = tinfoil.find_best_provider(testrecipe)
             if not best:
                 self.fail('Unable to find recipe providing %s' %

testrecipe)

Signature · 1 line
2.25.1
#2 lore raw
Quoted 9 lines · Richard Purdie

I'm not sure its this simple unfortunately.

The big question is whether injected changes from the first "session" should persist into the second "session" or whether things should be reset to a consistent state between them.

Yes, this will fix the test but I'm not sure its fixing the underlying problem :(

There's nothing else that can be done on the test side, and what goes on in the backend is way over my head, I'm afraid :-(

Alex