[BCI-3989][common] - CR methods err when service unstarted#705
Draft
[BCI-3989][common] - CR methods err when service unstarted#705
Conversation
This reverts commit 5006bec.
jmank88
reviewed
Sep 16, 2024
Comment on lines
302
to
303
| require.NoError(t, it.impl.Start(context.Background())) | ||
| t.Cleanup(func() { require.NoError(t, it.impl.Close()) }) |
Contributor
There was a problem hiding this comment.
Please use servicetest.Run. Notice it uses assert during cleanup.
…arted" This reverts commit e728084.
Farber98
commented
Sep 17, 2024
| ) | ||
|
|
||
| type ChainComponentsInterfaceTester[T TestingT[T]] interface { | ||
| type ChainComponentsTester[T any] interface { |
Contributor
Author
There was a problem hiding this comment.
- defined
ChainComponentsTesterso we use theSetup(t T, startCR bool)only forchainComponentstests - defined
chainComponentsTestcaseso we use thestartCRtestcase flag only forchainComponentstestcases - defined
runChainComponentsTeststo executechainComponentsspecific tests using theChainComponentsTesterinterface withSetup(t T, startCR bool)
| TestOn string | ||
| } | ||
|
|
||
| type codecTestcase[T any] struct { |
Contributor
Author
There was a problem hiding this comment.
- defined CodecTester so we use the
Setup(t T)without thestartCRflag for thecodec - defined
codecTestcaseso we don't use thestartCRtestcase flag forcodectestcases - defined
runCodecTeststo executecodecspecific tests using theCodecTesterinterface withSetup(t T)
| fake.stored = []TestStruct{} | ||
|
|
||
| if startCR { | ||
| servicetest.Run(t, it.impl) |
Contributor
Author
There was a problem hiding this comment.
added servicetest.Run(t, it.impl)
ilija42
requested changes
Sep 18, 2024
Contributor
ilija42
left a comment
There was a problem hiding this comment.
Wdyt about this solution
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.
solana ref: BCI-3989-cr-methods-error-when-unstarted
core ref: BCI-3989-cr-methods-error-when-unstarted
Task Description:
We only want
GetLatestValue,BatchGetLatestValueandQueryKeyto be called whenCRservice is inStartedstate. IfCRis not started yet, we should return an error.This PR:
Ticket:
Unblocks:
Merging flow: