Skip to content

roachtest: prevent shared mutable state across c2c roachtest runs#101220

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
msbutler:butler-c2c-roachtest-bug
Apr 11, 2023
Merged

roachtest: prevent shared mutable state across c2c roachtest runs#101220
craig[bot] merged 1 commit intocockroachdb:masterfrom
msbutler:butler-c2c-roachtest-bug

Conversation

@msbutler
Copy link
Copy Markdown
Collaborator

Previously, all c2c/* roachtests run with --count would provide incomprehensible results because multiple roachtest runs of the same test would override each other's state. Specifically, the latest call of test_spec.Run(), would override the test.Test harness, and syncedCluster.Cluster used by all other tests with the same registration.

This patch fixes this problem by moving all fields in replicationSpec that are set during test execution (i.e. a test_spec.Run call), to a new replicationDriver struct. Now, replicationSpec gets defined during test registration and is shared across test runs, while replicationDriver gets set within a test run.

Epic: None
Release note: None

Previously, all `c2c/*` roachtests run with `--count` would provide
incomprehensible results because multiple roachtest runs of the same test would
override each other's state. Specifically, the latest call of
`test_spec.Run()`, would override the `test.Test` harness, and
`syncedCluster.Cluster` used by all other tests with the same registration.

This patch fixes this problem by moving all fields in `replicationSpec` that are
set during test execution (i.e. a `test_spec.Run` call), to a new
`replicationDriver` struct. Now, `replicationSpec` gets defined during test
registration and is shared across test runs, while `replicationDriver`
gets set within a test run.

Epic: None
Release note: None
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@msbutler msbutler marked this pull request as ready for review April 11, 2023 15:02
@msbutler msbutler requested a review from a team as a code owner April 11, 2023 15:02
@msbutler msbutler requested review from benbardin, smg260 and srosenberg and removed request for a team April 11, 2023 15:02
@msbutler
Copy link
Copy Markdown
Collaborator Author

TFTR!

bors r=benbardin

@msbutler
Copy link
Copy Markdown
Collaborator Author

bors r=benbardin

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Apr 11, 2023

Build succeeded:

@craig craig bot merged commit 1abff58 into cockroachdb:master Apr 11, 2023
craig bot pushed a commit that referenced this pull request Apr 14, 2023
101447: c2c: randomize node shutdown timing in roachtests r=stevendanna a=msbutler

Previously, the c2c/nodeShutdown tests would only execute a shutdown after a high water mark was set and before a cutover timestamp was chosen. This patch randomizes the node shutdown to either occur during the initial scan, during this steady state phase, or during cutover.

This patch also fixes an infra bug that caused /src shutdown tests to run on /dest and /coordinator tests to run on /worker introduced in #101220.

Informs: #89487

Release note: none

Co-authored-by: Michael Butler <butler@cockroachlabs.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants