Skip to content

ccl/sqlproxyccl: add a test of closing the underlying connection#57385

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
jbowens:jackson/test-close-underylingconn
Dec 4, 2020
Merged

ccl/sqlproxyccl: add a test of closing the underlying connection#57385
craig[bot] merged 1 commit intocockroachdb:masterfrom
jbowens:jackson/test-close-underylingconn

Conversation

@jbowens
Copy link
Copy Markdown
Contributor

@jbowens jbowens commented Dec 2, 2020

Release note: none

@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Collaborator

@petermattis petermattis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm: assuming I'm understanding the test correctly.

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @jbowens, @petermattis, and @spaskob)


pkg/ccl/sqlproxyccl/proxy_test.go, line 257 at r1 (raw file):

func TestProxyTLSClose(t *testing.T) {
	defer leaktest.AfterTest(t)()

Is this what is actually testing that that the io.Copy goroutines are being torn down correctly when Close() is called? Might be worth a comment somewhere in this test if that is accurate as I generally think of the leaktest checks as being boilerplate, but in this case it is a critical part of the test.

Copy link
Copy Markdown
Collaborator

@petermattis petermattis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @jbowens and @spaskob)


pkg/ccl/sqlproxyccl/proxy_test.go, line 289 at r1 (raw file):

		incomingConn := proxyIncomingConn.Load().(*Conn)
		require.NoError(t, incomingConn.Close())
		<-incomingConn.Done() // should immediately proceed

I think the unused lint hack for Conn.Done can be removed.

Copy link
Copy Markdown
Contributor

@spaskob spaskob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for adding the test!

@jbowens jbowens force-pushed the jackson/test-close-underylingconn branch from 3329dc9 to a042eb8 Compare December 3, 2020 20:20
Copy link
Copy Markdown
Contributor Author

@jbowens jbowens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @petermattis)


pkg/ccl/sqlproxyccl/proxy_test.go, line 257 at r1 (raw file):

Previously, petermattis (Peter Mattis) wrote…

Is this what is actually testing that that the io.Copy goroutines are being torn down correctly when Close() is called? Might be worth a comment somewhere in this test if that is accurate as I generally think of the leaktest checks as being boilerplate, but in this case it is a critical part of the test.

Done.


pkg/ccl/sqlproxyccl/proxy_test.go, line 289 at r1 (raw file):

Previously, petermattis (Peter Mattis) wrote…

I think the unused lint hack for Conn.Done can be removed.

Done.

@jbowens jbowens force-pushed the jackson/test-close-underylingconn branch from a042eb8 to cbe3912 Compare December 3, 2020 21:12
@jbowens
Copy link
Copy Markdown
Contributor Author

jbowens commented Dec 3, 2020

TFTRs!

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Dec 4, 2020

Build succeeded:

@craig craig bot merged commit adbe5ff into cockroachdb:master Dec 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants