diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-11-07 11:56:53 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-11-09 11:45:37 +0000 |
commit | c6276d8e577fc7790d116d6c3e4e76883f4a32c2 (patch) | |
tree | 77660867341c768bdfc0cc84d717528384fba6d5 /meta/lib/oeqa/selftest/cases | |
parent | 6f427822e88442205c023de8215ab4cc55daff67 (diff) | |
download | poky-c6276d8e577fc7790d116d6c3e4e76883f4a32c2.tar.gz |
oeqa/selftest/sstatetests: Fix intermitttent errors and improve performance
You could reproduce an error in this test with:
bitbake core-image-minimal
bitbake tzcode-native -c cleansstate
oe-selftest -r sstatetests.SStatePrintdiff.test_image_minimal_vs_base_do_configure
since tzcode-native isn't needed once tzdata is available and isn't rebuilt
by "bitbake core-image-minimal" if it is missig. tzdata is allarch so if tzdata is
built on an x86 host, a aarch64 build machine would never build tzcode-native with
this set of calls.
Add a --runall option to the initial bitbake invocation to force these things to be
created if they're missing.
This explains why some failures were occurring on the infrastructure. With that issue
fixed, drop the hash mode change since I believe this fixes that issue. That
restriction was hurting performance, this should allow sstate reuse for the test
and improve the speed of it.
(From OE-Core rev: 8f03ac39e7fe21f3d6eca35b12b203a73a15285d)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/selftest/cases')
-rw-r--r-- | meta/lib/oeqa/selftest/cases/sstatetests.py | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/meta/lib/oeqa/selftest/cases/sstatetests.py b/meta/lib/oeqa/selftest/cases/sstatetests.py index a6865a5ba7..15032352f5 100644 --- a/meta/lib/oeqa/selftest/cases/sstatetests.py +++ b/meta/lib/oeqa/selftest/cases/sstatetests.py | |||
@@ -776,16 +776,15 @@ addtask tmptask2 before do_tmptask1 | |||
776 | self.assertEqual(recursecb_count,1) | 776 | self.assertEqual(recursecb_count,1) |
777 | 777 | ||
778 | class SStatePrintdiff(SStateBase): | 778 | class SStatePrintdiff(SStateBase): |
779 | # FIXME: OEBasicHash setting is necessary for now as otherwise the following error can occur: | ||
780 | # ERROR: Can't find a task we're supposed to have written out? (hash: e79d70b9c2cc72030c1ce822525510699a1eeb1ddf5986271d3217422244366a)? | ||
781 | # The underlying issue should be investigated and addressed. | ||
782 | def run_test_printdiff_changerecipe(self, target, change_recipe, change_bbtask, change_content, expected_sametmp_output, expected_difftmp_output): | 779 | def run_test_printdiff_changerecipe(self, target, change_recipe, change_bbtask, change_content, expected_sametmp_output, expected_difftmp_output): |
783 | self.write_config(""" | 780 | self.write_config(""" |
784 | TMPDIR = "${TOPDIR}/tmp-sstateprintdiff" | 781 | TMPDIR = "${TOPDIR}/tmp-sstateprintdiff" |
785 | BB_SIGNATURE_HANDLER = "OEBasicHash" | ||
786 | """) | 782 | """) |
787 | self.track_for_cleanup(self.topdir + "/tmp-sstateprintdiff") | 783 | self.track_for_cleanup(self.topdir + "/tmp-sstateprintdiff") |
788 | bitbake(target) | 784 | # Use runall do_build to ensure any indirect sstate is created, e.g. tzcode-native on both x86 and |
785 | # aarch64 hosts since only allarch target recipes depend upon it and it may not be built otherwise. | ||
786 | # A bitbake -c cleansstate tzcode-native would cause some of these tests to error for example. | ||
787 | bitbake("--runall build --runall deploy_source_date_epoch {}".format(target)) | ||
789 | bitbake("-S none {}".format(target)) | 788 | bitbake("-S none {}".format(target)) |
790 | bitbake(change_bbtask) | 789 | bitbake(change_bbtask) |
791 | self.write_recipeinc(change_recipe, change_content) | 790 | self.write_recipeinc(change_recipe, change_content) |
@@ -793,7 +792,6 @@ BB_SIGNATURE_HANDLER = "OEBasicHash" | |||
793 | 792 | ||
794 | self.write_config(""" | 793 | self.write_config(""" |
795 | TMPDIR = "${TOPDIR}/tmp-sstateprintdiff-2" | 794 | TMPDIR = "${TOPDIR}/tmp-sstateprintdiff-2" |
796 | BB_SIGNATURE_HANDLER = "OEBasicHash" | ||
797 | """) | 795 | """) |
798 | self.track_for_cleanup(self.topdir + "/tmp-sstateprintdiff-2") | 796 | self.track_for_cleanup(self.topdir + "/tmp-sstateprintdiff-2") |
799 | result_difftmp = bitbake("-S printdiff {}".format(target)) | 797 | result_difftmp = bitbake("-S printdiff {}".format(target)) |
@@ -807,17 +805,15 @@ BB_SIGNATURE_HANDLER = "OEBasicHash" | |||
807 | def run_test_printdiff_changeconfig(self, target, change_content, expected_sametmp_output, expected_difftmp_output): | 805 | def run_test_printdiff_changeconfig(self, target, change_content, expected_sametmp_output, expected_difftmp_output): |
808 | self.write_config(""" | 806 | self.write_config(""" |
809 | TMPDIR = "${TOPDIR}/tmp-sstateprintdiff" | 807 | TMPDIR = "${TOPDIR}/tmp-sstateprintdiff" |
810 | BB_SIGNATURE_HANDLER = "OEBasicHash" | ||
811 | """) | 808 | """) |
812 | self.track_for_cleanup(self.topdir + "/tmp-sstateprintdiff") | 809 | self.track_for_cleanup(self.topdir + "/tmp-sstateprintdiff") |
813 | bitbake(target) | 810 | bitbake("--runall build --runall deploy_source_date_epoch {}".format(target)) |
814 | bitbake("-S none {}".format(target)) | 811 | bitbake("-S none {}".format(target)) |
815 | self.append_config(change_content) | 812 | self.append_config(change_content) |
816 | result_sametmp = bitbake("-S printdiff {}".format(target)) | 813 | result_sametmp = bitbake("-S printdiff {}".format(target)) |
817 | 814 | ||
818 | self.write_config(""" | 815 | self.write_config(""" |
819 | TMPDIR = "${TOPDIR}/tmp-sstateprintdiff-2" | 816 | TMPDIR = "${TOPDIR}/tmp-sstateprintdiff-2" |
820 | BB_SIGNATURE_HANDLER = "OEBasicHash" | ||
821 | """) | 817 | """) |
822 | self.append_config(change_content) | 818 | self.append_config(change_content) |
823 | self.track_for_cleanup(self.topdir + "/tmp-sstateprintdiff-2") | 819 | self.track_for_cleanup(self.topdir + "/tmp-sstateprintdiff-2") |
@@ -879,7 +875,7 @@ expected_sametmp_output, expected_difftmp_output) | |||
879 | "Task gnu-config-native:do_configure couldn't be used from the cache because:", | 875 | "Task gnu-config-native:do_configure couldn't be used from the cache because:", |
880 | "We need hash", | 876 | "We need hash", |
881 | "most recent matching task was") | 877 | "most recent matching task was") |
882 | expected_sametmp_output = expected_output + ("Variable base_do_configure value changed",'+ echo "this changes base_do_configure() definiton"') | 878 | expected_sametmp_output = expected_output + ("Variable base_do_configure value changed",'+ echo "this changes base_do_configure() definiton "') |
883 | expected_difftmp_output = expected_output | 879 | expected_difftmp_output = expected_output |
884 | 880 | ||
885 | self.run_test_printdiff_changeconfig("core-image-minimal", | 881 | self.run_test_printdiff_changeconfig("core-image-minimal", |