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

sql: deflake TestTrackOnlyUserOpenTransactionsAndActiveStatements #120505

Conversation

rafiss
Copy link
Collaborator

@rafiss rafiss commented Mar 14, 2024

This changes the test to block in AfterExecute rather than OnTxnFinish, which should make the active statements assertion less flaky.

It also fixes a testing bug where the SELECT FOR UPDATE was not in a txn.

fixes #120042
fixes #120235
fixes #119829

Release note: None

@rafiss rafiss added backport-23.1.x Flags PRs that need to be backported to 23.1 backport-23.2.x Flags PRs that need to be backported to 23.2. labels Mar 14, 2024
@rafiss rafiss requested a review from fqazi March 14, 2024 17:32
@rafiss rafiss requested a review from a team as a code owner March 14, 2024 17:32
@rafiss rafiss requested review from a team and abarganier and removed request for a team March 14, 2024 17:32
@cockroach-teamcity
Copy link
Member

This change is Reviewable

This changes the test to block in AfterExecute rather than OnTxnFinish,
which should make the active statements assertion less flaky.

It also fixes a bug where the SELECT FOR UPDATE was not in a txn.

Release note: None
@rafiss rafiss force-pushed the deflake-TestTrackOnlyUserOpenTransactionsAndActiveStatements branch from 0726f79 to d6fd42f Compare March 14, 2024 20:22
@rafiss rafiss requested review from a team as code owners March 14, 2024 20:22
@rafiss rafiss requested review from msbutler and removed request for a team March 14, 2024 20:22
Copy link
Collaborator

@fqazi fqazi left a comment

Choose a reason for hiding this comment

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

Reviewed 5 of 5 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @abarganier, @msbutler, and @rafiss)


pkg/sql/conn_executor_test.go line 1669 at r1 (raw file):

	params := base.TestServerArgs{}
	params.Knobs.SQLExecutor = &sql.ExecutorTestingKnobs{
		AfterExecute: func(ctx context.Context, stmt string, isInternal bool, err error) {

I'm guessing this was because OnRecordTxnFinish

@rafiss
Copy link
Collaborator Author

rafiss commented Mar 15, 2024

tftr!

bors r+

@craig
Copy link
Contributor

craig bot commented Mar 15, 2024

@craig craig bot merged commit 1a6e93c into cockroachdb:master Mar 15, 2024
17 of 30 checks passed
Copy link

blathers-crl bot commented Mar 15, 2024

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 d6fd42f to blathers/backport-release-23.1-120505: 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.

@rafiss rafiss deleted the deflake-TestTrackOnlyUserOpenTransactionsAndActiveStatements branch March 15, 2024 20:54
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 backport-23.2.x Flags PRs that need to be backported to 23.2.
Projects
None yet
3 participants