-
Notifications
You must be signed in to change notification settings - Fork 24
[BCI-3989][common] - CR methods err when service unstarted #705
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
base: main
Are you sure you want to change the base?
Conversation
This reverts commit 5006bec.
| require.NoError(t, it.impl.Start(context.Background())) | ||
| t.Cleanup(func() { require.NoError(t, it.impl.Close()) }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use servicetest.Run. Notice it uses assert during cleanup.
…arted" This reverts commit e728084.
| ) | ||
|
|
||
| type ChainComponentsInterfaceTester[T TestingT[T]] interface { | ||
| type ChainComponentsTester[T any] interface { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 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 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added servicetest.Run(t, it.impl)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wdyt about this solution
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: