From: Aditya GS Date: Thu, 28 May 2026 18:57:22 +0000 (+0530) Subject: gawk: backport randtest stability fix X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=ccabae3036a713cac8b08731b765ff1dc3ed93eb;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git gawk: backport randtest stability fix Backport upstream fix to improve stability of randtest.sh by retrying when sigma is too small, avoiding intermittent failures. [YOCTO #16254] Signed-off-by: Aditya GS Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Richard Purdie --- diff --git a/meta/recipes-extended/gawk/files/randtest-fix.patch b/meta/recipes-extended/gawk/files/randtest-fix.patch new file mode 100644 index 00000000000..216b14e314c --- /dev/null +++ b/meta/recipes-extended/gawk/files/randtest-fix.patch @@ -0,0 +1,138 @@ +From f2250f4bc864913437619af7a9834a1c24915acd Mon Sep 17 00:00:00 2001 +From: "Arnold D. Robbins" +Date: Thu, 28 May 2026 09:52:41 -0400 +Subject: [PATCH] Improve test/randtest.sh. + +Backport upstream fix to improve stability of randtest.sh by retrying +when sigma is too small, avoiding intermittent failures. + +Upstream-Status: Backport [https://cgit.git.savannah.gnu.org/cgit/gawk.git/commit/?id=f2250f4bc864913437619af7a983] + +--- + +diff --git a/test/randtest.sh b/test/randtest.sh +index 597376a8..6ae6f830 100755 +--- a/test/randtest.sh ++++ b/test/randtest.sh +@@ -45,68 +45,77 @@ $AWK 'BEGIN{ + nsamples=('$NSAMPLES'); + max_allowed_sigma=('$MAX_ALLOWED_SIGMA'); + nruns=('$NRUNS'); +- for(tau=0;tau "pairpower_corr.data"; ++ # OPTIONALLY Print out the autocorrelation values: + +- # Calculate the sigma for the non-zero tau values: ++ # for(tau=0;tau "pairpower_corr.data"; + +- power_sum=0; ++ # Calculate the sigma for the non-zero tau values: + +- for(tau=1;tau max_allowed_sigma ) { +- print "Tau=", tau ", Autocorr=", corr[tau]/sigma, "sigma"; +- passed=0; +- } ++ if (sigma < 1e-6) { ++ print "Sigma too small, retrying run", retry ++ continue + } +- if(!passed) { +- print "Test failed." +- exit(1); ++ ++ # See if any of the correlations exceed a reasonable number of sigma: ++ ++ for(tau=1;tau max_allowed_sigma) { ++ print "Tau=", tau ", Autocorr=", corr[tau]/sigma, "sigma"; ++ print "Test failed." ++ exit 1 ++ } + } +- else exit (0); ++ ++ exit 0 + } + ++ print "Test failed after retries due to unstable sigma" ++ exit 1 ++} ++ + function abs(abs_input) { return(sqrt(abs_input^2)) ; } + ' + +-- +2.34.1 + diff --git a/meta/recipes-extended/gawk/gawk_5.4.0.bb b/meta/recipes-extended/gawk/gawk_5.4.0.bb index d7211f28f33..4193456c14f 100644 --- a/meta/recipes-extended/gawk/gawk_5.4.0.bb +++ b/meta/recipes-extended/gawk/gawk_5.4.0.bb @@ -28,6 +28,7 @@ PACKAGECONFIG[pma-if-64bit] = "--enable-pma,--disable-pma, " SRC_URI = "${GNU_MIRROR}/gawk/gawk-${PV}.tar.xz \ file://run-ptest \ file://0001-configure.ac-re-enable-disabled-printf-features.patch \ + file://randtest-fix.patch \ " SRC_URI[sha256sum] = "3dd430f0cd3b4428c6c3f6afc021b9cd3c1f8c93f7a688dc268ca428a90b4ac1"