File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
internal/namespaces/rdb/v1 Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ const (
3636var (
3737 sharedInstance * rdbSDK.Instance
3838 sharedInstanceMu sync.Mutex
39+ backupOpMu sync.Mutex
3940)
4041
4142// TestMain ensures shared instance cleanup
@@ -326,7 +327,11 @@ func BenchmarkBackupGet(b *testing.B) {
326327
327328 meta ["Instance" ] = rdb.CreateInstanceResult {Instance : instance }
328329
329- if err := createBackupDirect ("Backup" )(ctx ); err != nil {
330+ backupOpMu .Lock ()
331+ err := createBackupDirect ("Backup" )(ctx )
332+ backupOpMu .Unlock ()
333+
334+ if err != nil {
330335 b .Fatalf ("Failed to create backup: %v" , err )
331336 }
332337
@@ -387,10 +392,16 @@ func BenchmarkBackupList(b *testing.B) {
387392
388393 meta ["Instance" ] = rdb.CreateInstanceResult {Instance : instance }
389394
390- if err := createBackupDirect ("Backup1" )(ctx ); err != nil {
395+ backupOpMu .Lock ()
396+ err := createBackupDirect ("Backup1" )(ctx )
397+ if err != nil {
398+ backupOpMu .Unlock ()
391399 b .Fatalf ("Failed to create backup 1: %v" , err )
392400 }
393- if err := createBackupDirect ("Backup2" )(ctx ); err != nil {
401+ err = createBackupDirect ("Backup2" )(ctx )
402+ backupOpMu .Unlock ()
403+
404+ if err != nil {
394405 b .Fatalf ("Failed to create backup 2: %v" , err )
395406 }
396407
You can’t perform that action at this time.
0 commit comments