chore(model): slightly deflake TestRecvOnlyRevertOwnID (#10390)

Signed-off-by: Jakob Borg <jakob@kastelo.net>
This commit is contained in:
Jakob Borg
2025-09-12 09:41:47 +00:00
committed by GitHub
parent 9ee208b441
commit c23f9537f1
+3 -2
View File
@@ -459,6 +459,7 @@ func TestRecvOnlyRevertOwnID(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background()) ctx, cancel := context.WithCancel(context.Background())
defer cancel() defer cancel()
go func() { go func() {
defer cancel()
for { for {
select { select {
case <-ctx.Done(): case <-ctx.Done():
@@ -466,9 +467,9 @@ func TestRecvOnlyRevertOwnID(t *testing.T) {
case <-sub.C(): case <-sub.C():
if file, _ := m.testCurrentFolderFile(f.ID, name); file.Deleted { if file, _ := m.testCurrentFolderFile(f.ID, name); file.Deleted {
t.Error("local file was deleted") t.Error("local file was deleted")
cancel() return
} else if file.IsEquivalent(fi, f.modTimeWindow) { } else if file.IsEquivalent(fi, f.modTimeWindow) {
cancel() // That's what we are waiting for return // That's what we are waiting for
} }
} }
} }