Skip to content

Commit

Permalink
vitessdriver: fix test logic + rm address check
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Perkins <derek@nozzle.io>
  • Loading branch information
derekperkins committed Dec 30, 2021
1 parent 4376661 commit 9fa3327
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 0 additions & 3 deletions go/vt/vitessdriver/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,6 @@ func DistributedTxFromSessionToken(ctx context.Context, c Configuration) (*sql.T
if c.SessionToken == "" {
return nil, errors.New("c.SessionToken is required")
}
if c.Address == "" {
return nil, errors.New("c.Address is required")
}

db, err := OpenWithConfiguration(c)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions go/vt/vitessdriver/driver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ func TestSessionToken(t *testing.T) {
}

err = noRollbackTx.Rollback()
if err != nil && err.Error() != "calling Rollback from a distributed tx is not allowed" {
if err == nil || err.Error() != "calling Rollback from a distributed tx is not allowed" {
t.Fatal(err)
}

Expand All @@ -700,7 +700,7 @@ func TestSessionToken(t *testing.T) {
}

err = noCommitTx.Commit()
if err != nil && err.Error() != "calling Commit from a distributed tx is not allowed" {
if err == nil || err.Error() != "calling Commit from a distributed tx is not allowed" {
t.Fatal(err)
}

Expand Down

0 comments on commit 9fa3327

Please sign in to comment.