Skip to content

Commit

Permalink
Fix missing locking in mount tests (#29110)
Browse files Browse the repository at this point in the history
  • Loading branch information
VioletHynes authored and Monkeychip committed Dec 18, 2024
1 parent 098a631 commit 17af255
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions vault/mount_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ func TestCore_DefaultMountTable(t *testing.T) {

c.mountsLock.Lock()
defer c.mountsLock.Unlock()
c2.mountsLock.Lock()
defer c2.mountsLock.Unlock()
if diff := deep.Equal(c.mounts.sortEntriesByPath(), c2.mounts.sortEntriesByPath()); len(diff) > 0 {
t.Fatalf("mismatch: %v", diff)
}
Expand Down Expand Up @@ -192,6 +194,8 @@ func TestCore_Mount(t *testing.T) {
// Verify matching mount tables
c.mountsLock.Lock()
defer c.mountsLock.Unlock()
c2.mountsLock.Lock()
defer c2.mountsLock.Unlock()
if diff := deep.Equal(c.mounts.sortEntriesByPath(), c2.mounts.sortEntriesByPath()); len(diff) > 0 {
t.Fatalf("mismatch: %v", diff)
}
Expand Down Expand Up @@ -266,6 +270,8 @@ func TestCore_Mount_kv_generic(t *testing.T) {
// Verify matching mount tables
c.mountsLock.Lock()
defer c.mountsLock.Unlock()
c2.mountsLock.Lock()
defer c2.mountsLock.Unlock()
if diff := deep.Equal(c.mounts.sortEntriesByPath(), c2.mounts.sortEntriesByPath()); len(diff) > 0 {
t.Fatalf("mismatch: %v", diff)
}
Expand Down

0 comments on commit 17af255

Please sign in to comment.