Use antithesis's random#21989
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: nwnt The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
| # inject assertions in place of gofail | ||
| WORKDIR /etcd/server | ||
| RUN go install golang.org/x/tools/cmd/goimports@latest | ||
| RUN go get github.com/antithesishq/antithesis-sdk-go@v0.4.4 | ||
| RUN for file in $(grep -rl '// gofail'); do sed -i 's|\/\/ gofail.*var \([[:alnum:]]*\) .*|assert\.Reachable("\1", nil)|' $file; goimports -w $file; done |
There was a problem hiding this comment.
This move is needed because otherwise the patch would run into an error. Basically we just need to sed after the patch.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted filessee 17 files with indirect coverage changes @@ Coverage Diff @@
## main #21989 +/- ##
==========================================
- Coverage 69.66% 69.61% -0.05%
==========================================
Files 449 449
Lines 38177 38177
==========================================
- Hits 26596 26577 -19
- Misses 10149 10167 +18
- Partials 1432 1433 +1 Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
|
We don't want a large patch, can we just run sed to replace |
|
We can't actually do that willy-nilly as Antithesis's Let me think if there's a way to do so, but that might involve a script, which I can try to make it small. |
Signed-off-by: Nont <9658731+nwnt@users.noreply.github.com>
Signed-off-by: Nont <9658731+nwnt@users.noreply.github.com>
1d5dab8 to
b6c66dc
Compare
|
@nwnt: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Fixes #21720
Instead of rolling my own implementation, I'm making everything that uses
math/randbecome something like the following:which should satisfy the requirements described here.
The patch is a bit large because I did not want to write a small program or script to patch everything on the fly just yet as there are a lot of different usages of
math/rand. That might be something to do in the future once we have proven that this work. The files and usages are looked up by the following command:cc @serathius @marcus-hodgson-antithesis @henrybear327