From a513aced1dca420f47104c15102f1f7f068e5586 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@meta.com>
Date: Mon, 7 Apr 2025 22:42:22 -0700
Subject: [PATCH] tests: hash-collision-perf: avoid test hang on GNU/Hurd

This test would hang on GNU/Hurd because the perl code we use to measure
subsecond duration isn't ported, and that loop would never terminate.
* tests/hash-collision-perf: Detect the always-0 small_ms, and skip the test.
Reported by Bruno Haible in https://bugs.gnu.org/77613
---
 tests/hash-collision-perf | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/hash-collision-perf b/tests/hash-collision-perf
index b9a5b51..896d780 100755
--- a/tests/hash-collision-perf
+++ b/tests/hash-collision-perf
@@ -34,6 +34,9 @@ while :; do
   small_ms=$(LC_ALL=C user_time_ 1 grep --file=in empty) || fail=1
   test $small_ms -ge 200 && break
   n_pat=$(expr $n_pat '*' 2)
+  case $n_pat:$small_ms in
+    640000:0) skip_ 'user_time_ appears always to report 0 elapsed ms';;
+  esac
 done

 # Now, search for those same digits mapped to A-J.
-- 
2.49.0.154.g9d22ac5122

