haskellPackages.lzma-conduit: pick upstream patch to fix flaky failures

Had to manually trim down the patch because filterdiff couldn't manage
filtering out just the changes in tests/…
This commit is contained in:
sterni
2026-09-05 13:31:51 +02:00
parent 8c4ee9bc8c
commit 2e8fa702e3
2 changed files with 28 additions and 3 deletions

View File

@@ -909,9 +909,14 @@ with haskellLib;
# 2022-01-29: Tests require package to be in ghc-db.
aeson-schemas = dontCheck super.aeson-schemas;
# Too strict bounds on transformers and resourcet
# https://github.com/alphaHeavy/lzma-conduit/issues/23 krank:ignore-line
lzma-conduit = doJailbreak super.lzma-conduit;
lzma-conduit = lib.pipe super.lzma-conduit [
# Too strict bounds on transformers and resourcet
# https://github.com/alphaHeavy/lzma-conduit/issues/23 krank:ignore-line
doJailbreak
# Forbid small inputs in test suite which fail an assertion
# https://github.com/alphaHeavy/lzma-conduit/issues/25 krank:ignore-line
(appendPatch ./patches/lzma-conduit-prevent-flaky-failures.patch)
];
# 2020-06-05: HACK: does not pass own build suite - `dontCheck`
# 2024-01-15: too strict bound on free < 5.2

View File

@@ -0,0 +1,20 @@
From f5a907574e3d77e1eb4768f4cc9807efcc753071 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Thu, 2 Oct 2025 04:02:54 +0000
Subject: [PATCH] Fix test failure for small inputs by adding precondition
Co-authored-by: NathanHowell <170829+NathanHowell@users.noreply.github.com>
---
diff --git a/tests/Main.hs b/tests/Main.hs
index 140c942..7a69a72 100644
--- a/tests/Main.hs
+++ b/tests/Main.hs
@@ -52,6 +52,7 @@ prop_compressAndDiscard = monadicIO . forAllM someBigString $ \ str -> do
prop_compressAndCheckLength :: Property
prop_compressAndCheckLength = monadicIO . forAllM someBigString $ \ str -> do
+ pre $ B.length str > 64
len <- run . runResourceT $ Cl.sourceList [str] C.$$ compress Nothing C.=$= Cl.fold (\ acc el -> acc + B.length el) 0
-- random strings don't compress very well
assert (len > B.length str `div` 2)