Skip to content

Commit

Permalink
test: fix TestGracefulShutdownCloseConcurrent hang
Browse files Browse the repository at this point in the history
We should release the lock even if connect fails.

Part of #281
  • Loading branch information
oleg-jukovec committed May 11, 2023
1 parent 4871044 commit e7b9897
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions shutdown_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -418,9 +418,12 @@ func TestGracefulShutdownCloseConcurrent(t *testing.T) {

// Do not wait till Tarantool register out watcher,
// test everything is ok even on async.

conn := test_helpers.ConnectWithValidation(t, shtdnServer, shtdnClntOpts)
defer conn.Close()
conn, err := Connect(shtdnServer, shtdnClntOpts)
if err != nil {
t.Errorf("Failed to connect: %s", err)
} else {
defer conn.Close()
}

// Wait till all connections created.
srvToStop.Done()
Expand Down

0 comments on commit e7b9897

Please sign in to comment.