Skip to content

Commit

Permalink
some crdb tests fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sleygin committed Jan 29, 2024
1 parent d9c00b8 commit 47fe27c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions pgconn/pgconn.go
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,12 @@ func (pgConn *PgConn) unlock() {
// ParameterStatus returns the value of a parameter reported by the server (e.g.
// server_version). Returns an empty string for unknown parameters.
func (pgConn *PgConn) ParameterStatus(key string) string {
// if we are in recovering state parameter statuses are undefined
// so we have to wait until we recover
if pgConn.IsRecovering() {
pgConn.WaitForRecover()
}

return pgConn.parameterStatuses[key]
}

Expand Down
2 changes: 1 addition & 1 deletion pgconn/recover_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func mustConnect(t *testing.T) *PgConn {
return conn
}

func TestCleanup(t *testing.T) {
func TestRecover(t *testing.T) {
t.Parallel()

var tests = []struct {
Expand Down

0 comments on commit 47fe27c

Please sign in to comment.