Fix flaky TestWatch when a fetch is reported in two rounds

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-22 10:24:11 +02:00
co-authored by Claude Sonnet 5.5
parent 651ab10f51
commit be2311d94c
+7 -1
View File
@@ -139,7 +139,13 @@ func TestWatch(t *testing.T) {
// a commit in another shell
git(t, filepath.Join(super, "libs", "store"), "commit", "-q", "--allow-empty", "-m", "Local")
if c := next(t, ch); c != (submodule.Change{Path: "libs/store", Local: true}) {
c := next(t, ch)
if c == (submodule.Change{Path: "src/net"}) {
// git fetch writes FETCH_HEAD and the refs at different moments, so
// with a 20ms poll it can be reported in two rounds
c = next(t, ch)
}
if c != (submodule.Change{Path: "libs/store", Local: true}) {
t.Errorf("after commit: %+v, want local change of libs/store", c)
}