Ver Fonte

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

Signed-off-by: Jakob Borg <[email protected]>
Jakob Borg há 1 mês atrás
pai
commit
3382ccc3f1
1 ficheiros alterados com 3 adições e 2 exclusões
  1. 3 2
      lib/model/folder_recvonly_test.go

+ 3 - 2
lib/model/folder_recvonly_test.go

@@ -459,6 +459,7 @@ func TestRecvOnlyRevertOwnID(t *testing.T) {
 	ctx, cancel := context.WithCancel(context.Background())
 	defer cancel()
 	go func() {
+		defer cancel()
 		for {
 			select {
 			case <-ctx.Done():
@@ -466,9 +467,9 @@ func TestRecvOnlyRevertOwnID(t *testing.T) {
 			case <-sub.C():
 				if file, _ := m.testCurrentFolderFile(f.ID, name); file.Deleted {
 					t.Error("local file was deleted")
-					cancel()
+					return
 				} else if file.IsEquivalent(fi, f.modTimeWindow) {
-					cancel() // That's what we are waiting for
+					return // That's what we are waiting for
 				}
 			}
 		}