@@ -1432,7 +1432,7 @@ func TestVolumeOperationConcurrency(t *testing.T) {
1432
1432
SourceVolumeId : testVolumeId + "2" ,
1433
1433
}
1434
1434
1435
- runRequest := func (req * csi.CreateSnapshotRequest ) chan error {
1435
+ runRequest := func (req * csi.CreateSnapshotRequest ) <- chan error {
1436
1436
response := make (chan error )
1437
1437
go func () {
1438
1438
_ , err := cs .CreateSnapshot (context .Background (), req )
@@ -1454,29 +1454,29 @@ func TestVolumeOperationConcurrency(t *testing.T) {
1454
1454
if err != nil {
1455
1455
serverError , ok := status .FromError (err )
1456
1456
if ! ok {
1457
- t .Fatalf ("Could not get error status code from err: %v" , err )
1457
+ t .Errorf ("Could not get error status code from err: %v" , err )
1458
1458
}
1459
1459
if serverError .Code () != codes .Aborted {
1460
- t .Fatalf ("Expected error code: %v, got: %v. err : %v" , codes .Aborted , serverError .Code (), err )
1460
+ t .Errorf ("Expected error code: %v, got: %v. err : %v" , codes .Aborted , serverError .Code (), err )
1461
1461
}
1462
1462
} else {
1463
- t .Fatalf ("Expected error: %v, got no error" , codes .Aborted )
1463
+ t .Errorf ("Expected error: %v, got no error" , codes .Aborted )
1464
1464
}
1465
1465
case <- readyToExecute :
1466
- t .Fatal ("The operation for vol1PublishTargetB should have been aborted, but was started" )
1466
+ t .Errorf ("The operation for vol1PublishTargetB should have been aborted, but was started" )
1467
1467
}
1468
1468
1469
1469
// Start vol2CreateSnapshot and allow it to execute to completion. Then check for success.
1470
1470
vol2CreateSnapshotResp := runRequest (vol2CreateSnapshotReq )
1471
1471
execVol2CreateSnapshot := <- readyToExecute
1472
1472
execVol2CreateSnapshot <- struct {}{}
1473
1473
if err := <- vol2CreateSnapshotResp ; err != nil {
1474
- t .Fatalf ("Unexpected error: %v" , err )
1474
+ t .Errorf ("Unexpected error: %v" , err )
1475
1475
}
1476
1476
1477
- // To clean up, allow the vol1PublishTargetA to complete
1477
+ // To clean up, allow the vol1CreateSnapshotA to complete
1478
1478
execVol1CreateSnapshotA <- struct {}{}
1479
1479
if err := <- vol1CreateSnapshotAResp ; err != nil {
1480
- t .Fatalf ("Unexpected error: %v" , err )
1480
+ t .Errorf ("Unexpected error: %v" , err )
1481
1481
}
1482
1482
}
0 commit comments