diff options
| author | Brad Fitzpatrick <bradfitz@tailscale.com> | 2026-04-14 04:56:56 +0000 |
|---|---|---|
| committer | Brad Fitzpatrick <brad@danga.com> | 2026-04-14 06:55:35 -0700 |
| commit | 49eb1b5d26c7276764fc42e9e823893ffa522b6e (patch) | |
| tree | 9f39d0f0c0f25b01932b1d94c994707d370f73b3 /control/controlhttp/controlhttpserver/controlhttpserver.go | |
| parent | 27f1d4c15ddf725b83db1a34ed443b9165ce9e7a (diff) | |
| download | tailscale-49eb1b5d26c7276764fc42e9e823893ffa522b6e.tar.xz tailscale-49eb1b5d26c7276764fc42e9e823893ffa522b6e.zip | |
net/dns: fix TestDNSTrampleRecovery failure under flakestress
The test had two problems:
1. runFileWatcher passed hardcoded "/etc/" to the inotify watcher,
but the test filesystem uses a temp directory prefix. The watcher
was watching the real /etc/, never seeing the test's file writes.
2. The test's watchFile used gonotify.NewDirWatcher which creates
goroutines that block on real inotify syscalls. These don't work
inside synctest's fake-time bubble. The test only passed standalone
by accident: gonotify walks /etc/ on startup producing fake events
that happened to trigger trample detection at the right time.
Fix the path issue by adding ActualPath to the wholeFileFS interface,
which translates logical paths (like "/etc/resolv.conf") to real
filesystem paths (respecting any test prefix). Use it in
runFileWatcher so the inotify watch targets the correct directory.
Replace gonotify in the test with a one-shot timer that synctest can
advance through fake time, reliably triggering the trample check.
Fixes #19400
Change-Id: Idb252881ec24d0ab3b3c1d154dbdaf532db837d4
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
Diffstat (limited to 'control/controlhttp/controlhttpserver/controlhttpserver.go')
0 files changed, 0 insertions, 0 deletions
