New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

roachtest: cluster ctors no longer take a test #31267

Merged
merged 1 commit into from Oct 15, 2018

Conversation

Projects
None yet
3 participants
@andreimatei
Member

andreimatei commented Oct 11, 2018

The divorcing of clusters from tests is now unavoidable, and this patch
is another step in that direction.
This patch changes the cluster ctors to not take a test at all. Instead,
c.setTest() needs to be called later to set c.t. The idea is that it can
be called multiple times on the same cluster (and also that eventually
it will not be needed at all).

Release note: None

@cockroach-teamcity

This comment has been minimized.

Show comment
Hide comment
@cockroach-teamcity

cockroach-teamcity Oct 11, 2018

Member

This change is Reviewable

Member

cockroach-teamcity commented Oct 11, 2018

This change is Reviewable

@petermattis

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained


pkg/cmd/roachtest/test_test.go, line 272 at r1 (raw file):

		{[]string{"hello+"}, "must match regex"},
		{[]string{strings.Repeat("y", 46)}, ""},
		{[]string{strings.Repeat("y", 100)}, "must match regex"},

Why did this change? The cluster name restriction is imposed on us by GCE.

@andreimatei

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained


pkg/cmd/roachtest/test_test.go, line 272 at r1 (raw file):

Previously, petermattis (Peter Mattis) wrote…

Why did this change? The cluster name restriction is imposed on us by GCE.

it changed because, as it was written, it was no longer failing because the cluster names that were generated based on the test input became a bit shorter (because the "cluster id" component of the name used to be set to a timestamp or something transparently inside the name creation functions, and now the caller is supposed to put it in the name (it it wants to).
I didn't compute the new magic 47 that breaks the camel's back and makes the name too long; instead I just verify that a really long name is rejected. I think it's sufficient, but I'll change if you want.

@petermattis

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained

roachtest: cluster ctors no longer take a test
The divorcing of clusters from tests is now unavoidable, and this patch
is another step in that direction.
This patch changes the cluster ctors to not take a test at all. Instead,
c.setTest() needs to be called later to set c.t. The idea is that it can
be called multiple times on the same cluster (and also that eventually
it will not be needed at all).

Release note: None
@andreimatei

I've had to lift the prepending of the username to the cluster name from makeClusterName(). It was updating a global that the racetest caught. I don't know why it only caught it now; I think it was always racy. Globals are evil.
PTAL.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained

@petermattis

:lgtm:

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale)

@andreimatei

bors r+

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained

craig bot pushed a commit that referenced this pull request Oct 15, 2018

Merge #31267
31267: roachtest: cluster ctors no longer take a test r=andreimatei a=andreimatei

The divorcing of clusters from tests is now unavoidable, and this patch
is another step in that direction.
This patch changes the cluster ctors to not take a test at all. Instead,
c.setTest() needs to be called later to set c.t. The idea is that it can
be called multiple times on the same cluster (and also that eventually
it will not be needed at all).

Release note: None

Co-authored-by: Andrei Matei <andrei@cockroachlabs.com>
@craig

This comment has been minimized.

Show comment
Hide comment
@craig

craig bot commented Oct 15, 2018

Build succeeded

@craig craig bot merged commit bfc6b80 into cockroachdb:master Oct 15, 2018

3 checks passed

GitHub CI (Cockroach) TeamCity build finished
Details
bors Build succeeded
Details
license/cla Contributor License Agreement is signed.
Details

@andreimatei andreimatei deleted the andreimatei:roachtest-set-test branch Oct 15, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment