coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/2] tests: use tail --debug to determine inotify support


From: Pádraig Brady
Subject: Re: [PATCH 2/2] tests: use tail --debug to determine inotify support
Date: Mon, 17 Nov 2025 15:05:49 +0000
User-agent: Mozilla Thunderbird Beta

On 14/11/2025 17:07, Pádraig Brady wrote:
+require_inotify_supported_()
+{
+  require_built_ tail timeout
+
+  touch file.debug
+  returns_ 124 timeout .1 tail -F --debug file.debug 2>debug.out ||
+    framework_failure_
+
+  # This may skip because:
+  #   inotify is not available in this build
+  #   inotify is not supported on this file system
+  #   tail didn't print the debug info within .1s (unlikely)
+  grep 'using notification mode' debug.out >/dev/null ||
+    skip_ 'inotify not detected'
+}

The above was unlikely to skip,
but we can make it more robust with retry_delay_().
I changed the above to the following and pushed.

detect_tail_mode_()
{
  touch tail.debug || framework_failure_
  returns_ 124 timeout "$1" tail -n0 -F --debug tail.debug 2>tail.mode ||
    framework_failure_
  grep 'using .* mode' tail.mode >/dev/null
}

require_inotify_supported_()
{
  require_built_ tail timeout

  retry_delay_ detect_tail_mode_ .1 4

  # This may skip because:
  #   inotify is not available in this build
  #   inotify is not supported on this file system
  #   tail didn't print the debug info within 1.5s (unlikely)
  grep 'using notification mode' tail.mode >/dev/null ||
    skip_ 'inotify not detected'
}




reply via email to

[Prev in Thread] Current Thread [Next in Thread]