Parcourir la source

storage, test: unlock transaction in the retry loop

Hitoshi Mitake il y a 10 ans
Parent
commit
af2569c2d8
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      storage/kvstore_test.go

+ 1 - 1
storage/kvstore_test.go

@@ -654,11 +654,11 @@ func TestRestoreContinueUnfinishedCompaction(t *testing.T) {
 		tx = s1.b.BatchTx()
 		tx.Lock()
 		ks, _ := tx.UnsafeRange(keyBucketName, revbytes, nil, 0)
+		tx.Unlock()
 		if len(ks) != 0 {
 			time.Sleep(100 * time.Millisecond)
 			continue
 		}
-		tx.Unlock()
 		return
 	}