diff mbox series

[2/2] selftest/SStateCacheManagement: pre-populate the cache

Message ID 20240130135556.4104447-2-alex@linutronix.de
State Accepted, archived
Commit b685c955289bf4d7d70bd0f4c1530b2bf13a30a6
Headers show
Series [1/2] selftest/SStateCacheManagement: do not manipulate ERROR_QA | expand

Commit Message

Alexander Kanavin Jan. 30, 2024, 1:55 p.m. UTC
This is another source of the test slowness: for some configurations
(building x86 on x86) the cache items are pre-populated in other
builds. For others (building 32 bit x86 on arm), they're not. Without
this step, the test would build them, write them to a private
sstate, and then throw it away.

The code is un-pythonic: it follows the style of the rest of the test,
and fixing that is perhaps for some other time.

With these two changes the notoriously slow test_sstate_cache_management_script_using_machine
takes just under 6 minutes, on an arm worker:

https://autobuilder.yoctoproject.org/typhoon/#/builders/127/builds/2820/steps/13/logs/stdio

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 meta/lib/oeqa/selftest/cases/sstatetests.py | 8 ++++++++
 1 file changed, 8 insertions(+)
diff mbox series

Patch

diff --git a/meta/lib/oeqa/selftest/cases/sstatetests.py b/meta/lib/oeqa/selftest/cases/sstatetests.py
index fb97243bf5e..55fdbb035f1 100644
--- a/meta/lib/oeqa/selftest/cases/sstatetests.py
+++ b/meta/lib/oeqa/selftest/cases/sstatetests.py
@@ -268,6 +268,14 @@  class SStateCacheManagement(SStateBase):
         self.assertTrue(global_config)
         self.assertTrue(target_config)
         self.assertTrue(len(global_config) == len(target_config), msg='Lists global_config and target_config should have the same number of elements')
+
+        for idx in range(len(target_config)):
+            self.append_config(global_config[idx])
+            self.append_recipeinc(target, target_config[idx])
+            bitbake(target)
+            self.remove_config(global_config[idx])
+            self.remove_recipeinc(target, target_config[idx])
+
         self.config_sstate(temp_sstate_location=True, add_local_mirrors=[self.sstate_path])
 
         # For now this only checks if random sstate tasks are handled correctly as a group.