Add SyncSuite and split existing suite code into reusable parts.#1837
Open
Nocccer wants to merge 4 commits intostretchr:masterfrom
Open
Add SyncSuite and split existing suite code into reusable parts.#1837Nocccer wants to merge 4 commits intostretchr:masterfrom
Nocccer wants to merge 4 commits intostretchr:masterfrom
Conversation
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.
Summary
This PR adds a new suite
SyncSuiteto run each suite test inside a synctest bubble.Hit me up if you miss some information or have some ideas to improve it.
Changes
SyncSuitesuite with ownRunSyncfunctionSetTimeto set a fixed time in the bubble. This is just a helper fortime.Until(ts)which is a trick to set a specific timestamp.Waitas a wrapper forsynctest.WaitMotivation
The current suite is not usable for
synctestif you define tickers, channels, etc insideSetupTest.I want to have a suite where each test is run inside a synctest bubble and handles
SetupTestandTeardownTestcorrectly (run aftersynctest.Test).The current workaround would be to call
SetupTestagain aftersynctest.Testwas called, which is not the intended way.Here is a codesnippet of the problem in the current suite:
Here is the current workaround to make it work:
Not Supported
SetupSuiteandTearDownSuiteis not supported because each bubble should have a fresh state.SetupSuitecould be supported if the people using the new suite never setup time related variables inside it. Because we cannot ensure this, i removed it for now.SetupSubTestandTearDownSubTestis not supported because you can't run a bubble inside a bubble (runsynctest.Testinsidesynctest.Test)Related issues
#1836
#1834