test(file-manager): stop the large directory filter test timing out the CI
CI / check (push) Successful in 4m58s

The 100ms bound on filtering 10000 entries is a wall clock measurement, and
it failed at 147ms in the release job while makepkg was still building next
to it, blocking the publication of the package for a test that guards
against a superlinear filter, not against a few milliseconds.

The limit is now one second, which still catches an implementation that
turns the listing into seconds, and the comment says why it is loose.
This commit is contained in:
BlackAngelTV committed 2026-12-03 11:31:11 +01:00
1 parent a142e0b596
commit 5a1ba595f1
1 file changed
+7 -2
+7 -2
View File
@@ -376,8 +376,13 @@ func TestFilterEntriesLargeDirectory(t *testing.T) {
if len(matches) == 0 {
t.Fatal("expected matches in a large directory")
}
if elapsed > 100*time.Millisecond {
t.Fatalf("filtering 10000 entries took %s, the limit is 100ms", elapsed)
// The bound is deliberately loose: this guards against the filter becoming
// superlinear (which turns 10000 entries into seconds), not against a few
// extra milliseconds. A wall clock threshold tight enough to measure the
// current implementation fails on a shared machine, where the same test
// went from 15ms to 147ms while makepkg was building next to it.
if elapsed > time.Second {
t.Fatalf("filtering 10000 entries took %s, the limit is 1s", elapsed)
}
}