diff --git a/package/Dockerfile b/package/Dockerfile index 6cb2a09933..978b569bd8 100644 --- a/package/Dockerfile +++ b/package/Dockerfile @@ -2,13 +2,6 @@ ARG BASE_IMAGE=debian:bookworm FROM ${BASE_IMAGE} -# Packaging runs in a vanilla distro image, so the tooling has to come -# from the distro's archive: debhelper for deb, rpm-build (and the -# systemd / find-debuginfo macros it depends on) for rpm. -# The container also uses git (real history) for -# build_pkg.sh's SOURCE_DATE_EPOCH; otherwise it falls back to a tarball -# download and the timestamp comes from wall-clock time. - COPY package/install-packaging-tools.sh /tmp/install-packaging-tools.sh RUN /tmp/install-packaging-tools.sh diff --git a/package/install-packaging-tools.sh b/package/install-packaging-tools.sh index a26159a204..06ab44ac93 100755 --- a/package/install-packaging-tools.sh +++ b/package/install-packaging-tools.sh @@ -22,12 +22,23 @@ case "${ID}" in ;; esac +# Packaging runs in a vanilla distro image, so the tooling comes from the distro's +# archive rather than from nixpkgs: +# +# - debhelper and dpkg-dev build the DEB +# - rpm-build builds the RPM, with systemd-rpm-macros and redhat-rpm-config +# supplying the systemd and find-debuginfo macros the spec uses +# - git gives build_pkg.sh a real history to read SOURCE_DATE_EPOCH from; +# without one the timestamp falls back to the wall clock +# - curl uploads the finished packages in publish_pkg.sh +# - ca-certificates lets curl and git verify TLS function install() { case "${ID}" in debian | ubuntu) apt-get update -y apt-get install -y --no-install-recommends \ ca-certificates \ + curl \ debhelper \ debhelper-compat \ dpkg-dev \ @@ -36,6 +47,7 @@ function install() { rhel | centos | rocky | almalinux) dnf install -y --setopt=install_weak_deps=False \ + curl-minimal \ git \ rpm-build \ redhat-rpm-config \ diff --git a/src/test/app/LedgerReplay_test.cpp b/src/test/app/LedgerReplay_test.cpp index 2e2c80d6f8..0853affab7 100644 --- a/src/test/app/LedgerReplay_test.cpp +++ b/src/test/app/LedgerReplay_test.cpp @@ -28,7 +28,6 @@ #include #include -#include #include #include #include @@ -53,6 +52,7 @@ #include #include +#include #include #include #include @@ -402,7 +402,7 @@ public: enum class PeerSetBehavior { Good, - Drop50, + DropAlternate, DropAll, DropSkipListReply, DropLedgerDeltaReply, @@ -445,17 +445,13 @@ struct TestPeerSet : public PeerSet protocol::MessageType type, std::shared_ptr const& peer) override { - int dropRate = 0; - if (behavior == PeerSetBehavior::Drop50) - { - dropRate = 50; - } - else if (behavior == PeerSetBehavior::DropAll) - { - dropRate = 100; - } + if (behavior == PeerSetBehavior::DropAll) + return; - if (randInt(1, 100) <= dropRate) + // Drop every other message deterministically. Alternating drops + // still exercise the timeout/retry path while guaranteeing every + // subtask eventually gets a reply. + if (behavior == PeerSetBehavior::DropAlternate && sendCount++ % 2 == 0) return; switch (type) @@ -500,6 +496,7 @@ struct TestPeerSet : public PeerSet LedgerReplayMsgHandler& remote; std::shared_ptr dummyPeer; PeerSetBehavior behavior; + std::atomic sendCount{0}; }; /** @@ -1397,7 +1394,7 @@ struct LedgerReplayer_test : public beast::unit_test::Suite case PeerSetBehavior::Good: testcase("good network"); break; - case PeerSetBehavior::Drop50: + case PeerSetBehavior::DropAlternate: testcase("network drops 50% messages"); break; case PeerSetBehavior::Repeat: @@ -1613,7 +1610,7 @@ struct LedgerReplayer_test : public beast::unit_test::Suite testAllInboundLedgers(4); testPeerSetBehavior(PeerSetBehavior::Good, 1); testPeerSetBehavior(PeerSetBehavior::Good); - testPeerSetBehavior(PeerSetBehavior::Drop50); + testPeerSetBehavior(PeerSetBehavior::DropAlternate); testPeerSetBehavior(PeerSetBehavior::Repeat); testStop(); testSkipListBadReply();