Skip to content

Commit f39081d

Browse files
authored
gnu: patch inotify-race tests to use Rust gdb breakpoints (#9908)
1 parent 43fcff8 commit f39081d

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

util/build-gnu.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,17 @@ sed -i -e "s|rm: cannot remove 'a/1': Permission denied|rm: cannot remove 'a/1/2
216216
# however there's a bug because `---dis` is an alias for: `---disable-inotify`
217217
sed -i -e "s|---dis ||g" tests/tail/overlay-headers.sh
218218

219+
# Patch inotify-race tests to use Rust source lines for gdb breakpoints.
220+
# GNU test checks for race between initial read and watch setup. Rust sets up
221+
# watchers before initial read, so no exact equivalent exists. We break at
222+
# watch_with_parent as the closest semantic match. -iex suppresses Rust debug
223+
# script auto-load warnings that would cause the test to skip.
224+
"${SED}" -i \
225+
-e "s|break_src=\"\$abs_top_srcdir/src/tail.c\"|break_src=\"${path_UUTILS}/src/uu/tail/src/follow/watch.rs\"|" \
226+
-e 's|break_line=$(grep -n ^tail_forever_inotify "$break_src")|break_line=$(grep -n "watcher_rx.watch_with_parent" "$break_src")|' \
227+
-e 's|gdb -nx --batch-silent|gdb -nx --batch-silent -iex "set auto-load no"|g' \
228+
tests/tail/inotify-race.sh tests/tail/inotify-race2.sh
229+
219230
# Do not FAIL, just do a regular ERROR
220231
sed -i -e "s|framework_failure_ 'no inotify_add_watch';|fail=1;|" tests/tail/inotify-rotate-resources.sh
221232

0 commit comments

Comments
 (0)