Skip to content
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

kvserver: deflake all tests that restart test cluster servers #106145

Merged
merged 15 commits into from
Jul 13, 2023

Conversation

tbg
Copy link
Member

@tbg tbg commented Jul 5, 2023

This PR reworks how TestCluster's reusable listeners work. They are now enforced in tests that restart servers under the same listening address, since restarting without one opens the door to a race where the port is now assigned to another process.

The 23.1 backport will address #105940.

Epic: None
Release note: None

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@tbg tbg force-pushed the TestSnapshotAfterTruncation branch 2 times, most recently from e36e0c2 to 635ec97 Compare July 11, 2023 18:28
@tbg tbg changed the title kvserver: deflake TestSnapshotAfterTruncation kvserver: deflake all tests that restart test cluster servers Jul 11, 2023
@tbg tbg added the backport-23.1.x Flags PRs that need to be backported to 23.1 label Jul 11, 2023
tbg added 15 commits July 12, 2023 01:00
We'll want to access it from `base`, which can't import `testutils` due to
dependency cycles.
We'll type assert on it in future commits.
Future commits will change the receiver to ReusableListener.
We'll clean up the possible confusion with `GetOrFail` (which will create the listener if not present) later.
This will replace the ReusableListeners flag and simplify all tests using it.

It's not used as of this commit, and all the tests using the soon-to-be-legacy
approach still pass.
They didn't do this before, and as a result were susceptible to flakes.

They were discovered through the checks introduced in follow-up commits. It
will be impossible to hold it wrong.
@tbg tbg force-pushed the TestSnapshotAfterTruncation branch from 635ec97 to 4e8a998 Compare July 12, 2023 00:01
@tbg tbg marked this pull request as ready for review July 13, 2023 08:41
@tbg tbg requested review from a team as code owners July 13, 2023 08:41
@tbg tbg requested a review from erikgrinaker July 13, 2023 08:56
Copy link
Contributor

@erikgrinaker erikgrinaker left a comment

Choose a reason for hiding this comment

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

Nice cleanup, thanks!

@tbg
Copy link
Member Author

tbg commented Jul 13, 2023

TFTR!

bors r=erikgrinaker

@craig
Copy link
Contributor

craig bot commented Jul 13, 2023

Build succeeded:

@craig craig bot merged commit 5a6c91a into cockroachdb:master Jul 13, 2023
6 of 7 checks passed
@blathers-crl
Copy link

blathers-crl bot commented Jul 13, 2023

Encountered an error creating backports. Some common things that can go wrong:

  1. The backport branch might have already existed.
  2. There was a merge conflict.
  3. The backport branch contained merge commits.

You might need to create your backport manually using the backport tool.


error creating merge commit from 5f4496b to blathers/backport-release-23.1-106145: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict []

you may need to manually resolve merge conflicts with the backport tool.

Backport to branch 23.1.x failed. See errors above.


🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-23.1.x Flags PRs that need to be backported to 23.1 db-cy-23
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants