[OE-core] [PATCH 2/2] sstatetests: limit the number of signature comparisons when differ

leonardo.sandoval.gonzalez at linux.intel.com leonardo.sandoval.gonzalez at linux.intel.com
Fri Aug 4 18:57:03 UTC 2017


From: Leonardo Sandoval <leonardo.sandoval.gonzalez at linux.intel.com>

For perfomance reasons, limit the number of signature comparisons when
stamps differ. The limit set is hardcoded to 20.

[YOCTO #11651]

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez at linux.intel.com>
---
 meta/lib/oeqa/selftest/cases/sstatetests.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/meta/lib/oeqa/selftest/cases/sstatetests.py b/meta/lib/oeqa/selftest/cases/sstatetests.py
index 0b36027918..695e2a86d5 100644
--- a/meta/lib/oeqa/selftest/cases/sstatetests.py
+++ b/meta/lib/oeqa/selftest/cases/sstatetests.py
@@ -468,9 +468,15 @@ http_proxy = "http://example.com/"
             # No changes, so we're done
             return
 
+        i_sigfile, max_sigfiles_to_compare = 0, 20
         for k in files1.keys() | files2.keys():
             if k in files1 and k in files2:
+                i_sigfile += 1
                 print("%s differs:" % k)
+                # this is an expensive computation, thus just compare the first
+                # 'max_sigfiles_to_compare' k files
+                if i_sigfile > max_sigfiles_to_compare:
+                    continue
                 sigdatafile1 = self.topdir + "/tmp-sstatesamehash/stamps/" + k + "." + files1[k]
                 sigdatafile2 = self.topdir + "/tmp-sstatesamehash2/stamps/" + k + "." + files2[k]
                 output = bb.siggen.compare_sigfiles(sigdatafile1, sigdatafile2)
-- 
2.12.3




More information about the Openembedded-core mailing list