dirwatch, lookup: one test below the synctest comment ran outside a bubble
check / check (push) Failing after 2m6s

In both test files the comment said every test below it runs in a
synctest bubble, but one did not. That test now sits above the comment.

Model: opus-5-5
This commit is contained in:
clawbot authored and clawbot committed 2026-11-19 20:39:16 +00:00
1 parent 2083584ee0
commit a0277879d7
2 files changed
+34 -34

No files matched your search

+9 -9
View File
@@ -15,6 +15,15 @@ import (
// errWatch is an error the watch reports.
var errWatch = errors.New("too many changes")
func TestDirectoryThatCannotBeWatchedIsAnError(t *testing.T) {
t.Parallel()
_, err := New(filepath.Join(t.TempDir(), "missing"))
if err == nil {
t.Error("a missing directory is watched, want an error")
}
}
// The tests below run callWhenQuiet in a synctest bubble, where time is a
// clock of the test's own: time.Sleep moves it on at once, and
// synctest.Wait returns once callWhenQuiet waits again, so that every call
@@ -107,15 +116,6 @@ func TestErrorsOfTheWatchHandedOn(t *testing.T) {
})
}
func TestDirectoryThatCannotBeWatchedIsAnError(t *testing.T) {
t.Parallel()
_, err := New(filepath.Join(t.TempDir(), "missing"))
if err == nil {
t.Error("a missing directory is watched, want an error")
}
}
// loop is a callWhenQuiet that a test runs.
type loop struct {
// changes and errs send it changes and errors.