Merge pull request #31263 from hashicorp/alisdair/backend-remote-locks-helper-lockerror-test

states/remote: Check for LockError error type
This commit is contained in:
Alisdair McDiarmid 2022-06-17 11:58:03 -04:00 committed by GitHub
commit 0f39ead096
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -77,6 +77,9 @@ func TestRemoteLocks(t *testing.T, a, b Client) {
lockerA.Unlock(lockIDA)
t.Fatal("client B obtained lock while held by client A")
}
if _, ok := err.(*statemgr.LockError); !ok {
t.Errorf("expected a LockError, but was %t: %s", err, err)
}
if err := lockerA.Unlock(lockIDA); err != nil {
t.Fatal("error unlocking client A", err)