Flakes: Address flakes in TestMoveTables* unit tests#16942
Merged
mattlord merged 1 commit intovitessio:mainfrom Oct 14, 2024
Merged
Flakes: Address flakes in TestMoveTables* unit tests#16942mattlord merged 1 commit intovitessio:mainfrom
mattlord merged 1 commit intovitessio:mainfrom
Conversation
Stop unnecessarily calling vrdbclient.Reset. And use mutex to protect fakeTMClient members. Signed-off-by: Matt Lord <mattalord@gmail.com>
Contributor
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #16942 +/- ##
==========================================
- Coverage 69.41% 69.40% -0.02%
==========================================
Files 1570 1570
Lines 203948 203942 -6
==========================================
- Hits 141576 141542 -34
- Misses 62372 62400 +28 ☔ View full report in Codecov by Sentry. |
rohit-nayak-ps
approved these changes
Oct 14, 2024
dbussink
approved these changes
Oct 14, 2024
vitess-bot
pushed a commit
that referenced
this pull request
Oct 14, 2024
Signed-off-by: Matt Lord <mattalord@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Since #16583 we've seen the
TestMoveTablesUnshardedandTestMoveTablesShardedtests become flaky. Especially the Sharded one.The only directly relevant change made to these unit tests in that PR is adding the
vrdbClient.Reset()call. That call however is not safe as it modifies the members while holding a mutex, most notably the done channel. The problem, however, is that we explicitly and intentionally do not take that mutex in theWait()function, which is the primary user of that channel.It's not 100% clear that this was the cause of the flakiness, but given that it was the only directly relevant change, we know it's unsafe, and CI failures that I saw (I was unable to repeat the test failures locally) seemed to indicate a repeated panic->recover cycle in the TabletManager which could be caused by unsafe channel manipulation:
The
Reset()function was being called for every shard, so that would also explain why the Sharded test was much more flaky than the Unsharded one.Given all of this AND the fact that using this
Reset()function is wholly unnecessary we remove its usage in this PR. We will then have to see how much this helps the somewhat random flakiness we've seen in the coming weeks.While here, I also added mutex usage to the
fakeTMClientmethods that weren't already using it so that we should be concurrent safe if we start doing more tests in parallel in the future.unit_racetest re-runs can be seen here: https://github.com/vitessio/vitess/actions/runs/11317748149/job/31471559199?pr=16942Related Issue(s)
Checklist