public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
To: git-commits@fedoraproject.org
Subject: [rpms/buildbox] rawhide: Add patch to fix casd cleanup-threshold unit test on non-x86
Date: Wed, 23 Sep 2026 00:35:35 GMT	[thread overview]
Message-ID: <179012373599.1.5750554082182020113.rpms-buildbox-968a2896c97c@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/buildbox
            Branch : rawhide
            Commit : 968a2896c97c426fac8a34412d45ada6a361d849
            Author : Javier Jardón <jjardon@gnome.org>
            Date   : 2026-09-23T01:34:43+01:00
            Stats  : +108/-0 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/buildbox/c/968a2896c97c426fac8a34412d45ada6a361d849?branch=rawhide

            Log:
            Add patch to fix casd cleanup-threshold unit test on non-x86

%check fails on aarch64, ppc64le and s390x:

  casd/test/buildboxcasd_cmdlinespec.t.cpp:310: Failure
  Expected equality of these values:
    0.8775
    daemon.d_cleanupThresholdRatio
      Which is: 0.87750000000000006
  [  FAILED  ] CmdLineSpecTest.NoActionCacheProxy

---
diff --git a/0001-casd-fix-default-cleanup-threshold-test-on-non-x86.patch b/0001-casd-fix-default-cleanup-threshold-test-on-non-x86.patch
new file mode 100644
index 0000000..86eb402
--- /dev/null
+++ b/0001-casd-fix-default-cleanup-threshold-test-on-non-x86.patch
@@ -0,0 +1,105 @@
+From f88a92f5f8098a05eb922dc35fafaac5326826b3 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Javier=20Jard=C3=B3n?= <jjardon@gnome.org>
+Date: Wed, 23 Sep 2026 01:27:52 +0100
+Subject: [PATCH] casd: fix default cleanup-threshold test on non-x86
+
+CmdLineSpecTest.NoActionCacheProxy fails on aarch64, ppc64le
+and s390x with the following:
+
+  casd/test/buildboxcasd_cmdlinespec.t.cpp:310: Failure
+  Expected equality of these values:
+    0.8775
+    daemon.d_cleanupThresholdRatio
+      Which is: 0.87750000000000006
+  [  FAILED  ] CmdLineSpecTest.NoActionCacheProxy
+
+Assert the computed default instead of the rounded literal.
+
+The helper is shared with configure() so the expected value
+is the same expression, not a second copy of 0.65 in the test file.
+---
+ casd/buildboxcasd_daemon.cpp             |  4 +---
+ casd/buildboxcasd_daemon.h               | 10 ++++++++++
+ casd/test/buildboxcasd_cmdlinespec.t.cpp |  9 ++++++---
+ 3 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/casd/buildboxcasd_daemon.cpp b/casd/buildboxcasd_daemon.cpp
+index 43774007..90da6449 100644
+--- a/casd/buildboxcasd_daemon.cpp
++++ b/casd/buildboxcasd_daemon.cpp
+@@ -58,7 +58,6 @@ namespace {
+ constexpr unsigned int DEFAULT_MAX_NUM_DIGEST_THREADS = 16;
+ constexpr unsigned int DEFAULT_MAX_NUM_IO_THREADS = 64;
+ constexpr int PERCENTAGE_BASE = 100;
+-constexpr double DEFAULT_CLEANUP_THRESHOLD_QUOTA_RATIO = 0.65;
+ 
+ std::pair<std::vector<std::string>,
+           std::unordered_map<std::string, std::string>>
+@@ -458,8 +457,7 @@ bool Daemon::configure(const buildboxcommon::CommandLine &cml,
+     else {
+         // Default to 65% of the way from the low to the high quota
+         d_cleanupThresholdRatio =
+-            d_quotaLowRatio +
+-            DEFAULT_CLEANUP_THRESHOLD_QUOTA_RATIO * (1 - d_quotaLowRatio);
++            defaultCleanupThresholdRatio(d_quotaLowRatio);
+         BUILDBOX_LOG_INFO(
+             "--cleanup-threshold was not specified, defaulting to 65% of the "
+             "way from the low to the high quota: "
+diff --git a/casd/buildboxcasd_daemon.h b/casd/buildboxcasd_daemon.h
+index 8b6e65f4..8f5fb1cb 100644
+--- a/casd/buildboxcasd_daemon.h
++++ b/casd/buildboxcasd_daemon.h
+@@ -35,6 +35,16 @@ namespace proto {
+ using namespace build::bazel::remote::execution::v2;
+ } // namespace proto
+ 
++// Fraction of the remaining quota range used when --cleanup-threshold
++// is omitted.
++constexpr double DEFAULT_CLEANUP_THRESHOLD_QUOTA_RATIO = 0.65;
++
++constexpr double defaultCleanupThresholdRatio(double quotaLowRatio)
++{
++    return quotaLowRatio +
++           DEFAULT_CLEANUP_THRESHOLD_QUOTA_RATIO * (1.0 - quotaLowRatio);
++}
++
+ class Daemon {
+   public:
+     Daemon() = default;
+diff --git a/casd/test/buildboxcasd_cmdlinespec.t.cpp b/casd/test/buildboxcasd_cmdlinespec.t.cpp
+index 7b96867c..c72ea165 100644
+--- a/casd/test/buildboxcasd_cmdlinespec.t.cpp
++++ b/casd/test/buildboxcasd_cmdlinespec.t.cpp
+@@ -307,7 +307,8 @@ TEST(CmdLineSpecTest, NoActionCacheProxy)
+     EXPECT_EQ("127.0.0.1:50011", daemon.d_bind_addresses.front());
+     EXPECT_EQ(0.65, daemon.d_quotaLowRatio);
+     EXPECT_EQ(64000000000, daemon.d_quotaHigh);
+-    EXPECT_EQ(0.8775, daemon.d_cleanupThresholdRatio);
++    EXPECT_EQ(buildboxcasd::defaultCleanupThresholdRatio(daemon.d_quotaLowRatio),
++              daemon.d_cleanupThresholdRatio);
+     EXPECT_EQ(3000000000, daemon.d_reserved_space);
+     EXPECT_TRUE(daemon.d_protect_session_blobs);
+     EXPECT_EQ(30, daemon.d_proxy_findmissingblobs_cache_ttl_seconds);
+@@ -356,7 +357,8 @@ TEST(CmdLineSpecTest, ReadOnlyArg)
+     EXPECT_EQ("127.0.0.1:50011", daemon.d_bind_addresses.front());
+     EXPECT_EQ(0.8, daemon.d_quotaLowRatio);
+     EXPECT_EQ(64000000000, daemon.d_quotaHigh);
+-    EXPECT_EQ(0.93, daemon.d_cleanupThresholdRatio);
++    EXPECT_EQ(buildboxcasd::defaultCleanupThresholdRatio(daemon.d_quotaLowRatio),
++              daemon.d_cleanupThresholdRatio);
+     EXPECT_EQ(3000000000, daemon.d_reserved_space);
+     EXPECT_TRUE(daemon.d_protect_session_blobs);
+     EXPECT_EQ(30, daemon.d_proxy_findmissingblobs_cache_ttl_seconds);
+@@ -593,7 +595,8 @@ TEST(CmdLineSpecTest, CleanupThresholdDefaultsToFractionOfQuotaRange)
+     buildboxcasd::Daemon daemon;
+     parse(daemon, args.size(), args.data());
+ 
+-    EXPECT_EQ(0.93, daemon.d_cleanupThresholdRatio);
++    EXPECT_EQ(buildboxcasd::defaultCleanupThresholdRatio(daemon.d_quotaLowRatio),
++              daemon.d_cleanupThresholdRatio);
+ }
+ 
+ TEST(CmdLineSpecTest, CleanupThresholdBelowQuotaLow)
+-- 
+2.55.0
+

diff --git a/buildbox.spec b/buildbox.spec
index 0bffad5..2a6916e 100644
--- a/buildbox.spec
+++ b/buildbox.spec
@@ -6,6 +6,9 @@ Summary: Building blocks to execute actions conforming to the Remote Execution A
 License: Apache-2.0
 URL:     https://buildgrid.gitlab.io/buildbox/buildbox-home/
 Source0: https://gitlab.com/BuildGrid/buildbox/buildbox/-/archive/%{version}/buildbox-%{version}.tar.bz2
+# CmdLineSpecTest.NoActionCacheProxy: EXPECT_EQ(0.8775, cleanupThreshold)
+# fails on aarch64/ppc64le/s390x (0.87750000000000006).
+Patch0:  0001-casd-fix-default-cleanup-threshold-test-on-non-x86.patch
 
 ExcludeArch: %{ix86}
 

                 reply	other threads:[~2026-09-23  0:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179012373599.1.5750554082182020113.rpms-buildbox-968a2896c97c@fedoraproject.org \
    --to=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox