diff options
author | Robert Hensing <roberth@users.noreply.github.com> | 2023-10-03 18:00:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-03 18:00:36 +0200 |
commit | c0838e12afa82d81668ab8550983e0521f117790 (patch) | |
tree | 32f9b1126697cb4a9abdf783d72a3523663766d9 /lib | |
parent | c02ab0ce6840dcb84b49f784982e4288fdddfa05 (diff) | |
parent | 3cbbea53a12ebd461e047e594027ee6777f36e68 (diff) |
Merge pull request #258080 from tweag/fileset/no-ulimit
lib.fileset: Don't use non-reproducible ulimit for stack overflow testing
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/fileset/tests.sh | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/fileset/tests.sh b/lib/fileset/tests.sh index 0ea96859e7a34..774b8f29d93fe 100755 --- a/lib/fileset/tests.sh +++ b/lib/fileset/tests.sh @@ -467,12 +467,13 @@ for i in $(seq 1000); do tree[$i/a]=1 tree[$i/b]=0 done -( - # Locally limit the maximum stack size to 100 * 1024 bytes - # If unions was implemented recursively, this would stack overflow - ulimit -s 100 - checkFileset 'unions (mapAttrsToList (name: _: ./. + "/${name}/a") (builtins.readDir ./.))' -) +# This is actually really hard to test: +# A lot of files would be needed to cause a stack overflow. +# And while we could limit the maximum stack size using `ulimit -s`, +# that turns out to not be very deterministic: https://github.com/NixOS/nixpkgs/pull/256417#discussion_r1339396686. +# Meanwhile, the test infra here is not the fastest, creating 10000 would be too slow. +# So, just using 1000 files for now. +checkFileset 'unions (mapAttrsToList (name: _: ./. + "/${name}/a") (builtins.readDir ./.))' # TODO: Once we have combinators and a property testing library, derive property tests from https://en.wikipedia.org/wiki/Algebra_of_sets |