From fac5a1b10a6979a7898c5c3555d62b593560772f Mon Sep 17 00:00:00 2001
From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>
Date: Mon, 22 Dec 2025 11:55:06 +0100
Subject: [PATCH] test: Allow mempool_updatefromblock.py to run on 32-bit

---
 ci/test/00_setup_env_arm.sh                |  2 --
 test/functional/mempool_updatefromblock.py | 15 ++++++++++-----
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/ci/test/00_setup_env_arm.sh b/ci/test/00_setup_env_arm.sh
index c410a80d8b2304ea4942ee740e4f16a3d47d0cbb..0d05877b6cf4ca68b4165a9520c6668d235fccb1 100755
--- a/ci/test/00_setup_env_arm.sh
+++ b/ci/test/00_setup_env_arm.sh
@@ -12,8 +12,6 @@ export PACKAGES="python3-zmq g++-arm-linux-gnueabihf libc6:armhf libstdc++6:armh
 export CONTAINER_NAME=ci_arm_linux
 export CI_IMAGE_NAME_TAG="mirror.gcr.io/ubuntu:24.04"  # Check that https://packages.ubuntu.com/noble/g++-arm-linux-gnueabihf (version 13.x, similar to guix) can cross-compile
 export CI_IMAGE_PLATFORM="linux/arm64"
-export RUN_UNIT_TESTS=true
-export RUN_FUNCTIONAL_TESTS=false
 export GOAL="install"
 export CI_LIMIT_STACK_SIZE=1
 # -Wno-psabi is to disable ABI warnings: "note: parameter passing for argument of type ... changed in GCC 7.1"
diff --git a/test/functional/mempool_updatefromblock.py b/test/functional/mempool_updatefromblock.py
index 3a201ae461c6a8392ae9da18f14087d9db5ff932..11571f6f430d1323ffa51f5a269167ba3e980b1b 100755
--- a/test/functional/mempool_updatefromblock.py
+++ b/test/functional/mempool_updatefromblock.py
@@ -13,7 +13,7 @@
 
 from test_framework.blocktools import create_empty_fork
 from test_framework.test_framework import BitcoinTestFramework
-from test_framework.util import assert_equal, assert_raises_rpc_error
+from test_framework.util import assert_equal, assert_greater_than_or_equal, assert_raises_rpc_error
 from test_framework.wallet import MiniWallet
 from test_framework.mempool_util import DEFAULT_CLUSTER_LIMIT
 
@@ -161,12 +161,17 @@ def test_max_disconnect_pool_bytes(self):
         # but not all, and any time parent is dropped, child is also removed
         self.trigger_reorg(fork_blocks=fork_blocks)
         mempool = self.nodes[0].getrawmempool()
-        expected_parent_count = len(large_std_txs) - 2
-        assert_equal(len(mempool), expected_parent_count * 2)
+        # At least one parent must be dropped, but more may be dropped,
+        # depending on the dynamic cost overhead.
+        expected_parent_count = len(large_std_txs) - 1
+        assert_greater_than_or_equal(expected_parent_count * 2, len(mempool))
+        expected_parent_count = len(mempool) // 2
+
+        parent_presence = [tx["txid"] in mempool for tx in large_std_txs]
 
         # The txns at the end of the list, or most recently confirmed, should have been trimmed
-        assert_equal([tx["txid"] in mempool for tx in large_std_txs], [tx["txid"] in mempool for tx in small_child_txs])
-        assert_equal([tx["txid"] in mempool for tx in large_std_txs], [True] * expected_parent_count + [False] * 2)
+        assert_equal(parent_presence, [tx["txid"] in mempool for tx in small_child_txs])
+        assert_equal(parent_presence, [True] * expected_parent_count + [False] * (len(large_std_txs) - expected_parent_count))
 
     def test_chainlimits_exceeded(self):
         self.log.info('Check that too long chains on reorg are handled')
