From 4e61156dc499609b8786abad2be3310ebb4ba5e6 Mon Sep 17 00:00:00 2001 From: Humble Chirammal Date: Fri, 8 Oct 2021 13:55:01 +0530 Subject: [PATCH] rbd: change iteration variable name in the migration test to be specific we reuse or overload the variable name in the test execution at present. This commit use a different variable name as initialized in each run Signed-off-by: Humble Chirammal --- internal/rbd/migration_test.go | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/internal/rbd/migration_test.go b/internal/rbd/migration_test.go index a32e0d294..a03f6a57a 100644 --- a/internal/rbd/migration_test.go +++ b/internal/rbd/migration_test.go @@ -54,12 +54,12 @@ func TestIsMigrationVolID(t *testing.T) { }, } for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { + newtt := tt + t.Run(newtt.name, func(t *testing.T) { t.Parallel() - got := isMigrationVolID(tt.args) - if got != tt.migVolID { - t.Errorf("isMigrationVolID() = %v, want %v", got, tt.migVolID) + got := isMigrationVolID(newtt.args) + if got != newtt.migVolID { + t.Errorf("isMigrationVolID() = %v, want %v", got, newtt.migVolID) } }) } @@ -156,17 +156,17 @@ func TestParseMigrationVolID(t *testing.T) { }, } for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { + newtt := tt + t.Run(newtt.name, func(t *testing.T) { t.Parallel() - got, err := parseMigrationVolID(tt.args) - if (err != nil) != tt.wantErr { - t.Errorf("ParseMigrationVolID() error = %v, wantErr %v", err, tt.wantErr) + got, err := parseMigrationVolID(newtt.args) + if (err != nil) != newtt.wantErr { + t.Errorf("ParseMigrationVolID() error = %v, wantErr %v", err, newtt.wantErr) return } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("ParseMigrationVolID() got = %v, want %v", got, tt.want) + if !reflect.DeepEqual(got, newtt.want) { + t.Errorf("ParseMigrationVolID() got = %v, want %v", got, newtt.want) } }) }