-
Notifications
You must be signed in to change notification settings - Fork 20.9k
cmd/workload: implement checks for history-pruned node #31355
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
Conversation
It's not supposed to skip these tests, it should still call the function but check that the returned error has the correct error code (4444). |
Yesterday, you said that this could be worked on right now even though we don't currently have the history-truncation rpc error return implemented. I took that to mean that we would just skip affected test cases. |
Yeah, so what I mean is, these tests would fail against a pruned node. But that's OK. They already fail now because the node returns an arbitrary error. |
Okay, so afaict this is blocked until we can surface the pruned history error from the relevant rpc calls, which itself requires the dependent components under the hood to properly distinguish it. |
No it's not. You can just add a verification for the error code here. |
aa090ca
to
9d5c9f3
Compare
Maybe add a helper function for this check |
Yeah agreed, it's a bit verbose. |
cmd/workload/historytest.go
Outdated
// code of 4444. | ||
func errIsPrunedHistory(err error) bool { | ||
if err != nil { | ||
if rpcErr := err.(rpc.Error); rpcErr != nil && rpcErr.ErrorCode() == 4444 { |
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.
rpcErr := err.(rpc.Error)
will crash if it doesn't satisfy the interface. You need to capture the second return value to check if it was OK.
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.
oof
TODO (self): ensure in the tests that if the 4444 code is emitted when the test block (or range) is passed the prune threshold, the tests error. |
…g failure to access missing pruned history, don't mark that test run as a failure
…om pruned history
…ning threshold. if so, it is an error
lint is red, also pls add a pr description |
3bb3667
to
b0eaf5f
Compare
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.
It's not pretty, but there isn't really a good way to do this better.
Co-authored-by: Felix Lange <[email protected]>
Co-authored-by: Felix Lange <[email protected]>
Co-authored-by: Felix Lange <[email protected]>
No description provided.