Skip to content
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

Robustness tests should validate if etcd binary supports gofail #15258

Closed
serathius opened this issue Feb 7, 2023 · 15 comments
Closed

Robustness tests should validate if etcd binary supports gofail #15258

serathius opened this issue Feb 7, 2023 · 15 comments

Comments

@serathius
Copy link
Member

serathius commented Feb 7, 2023

What would you like to be added?

Etcd robustness tests scenarios that require gofail should validate that etcd binary was complied with gofail enabled and if it's not it should provide a verbose error with instructions how to compile etcd.

Why is this needed?

It's not obvious for new users that linearizability tests require etcd build with gofail enabled.
Error is not very verbose: "connection refused" error from a goPanicFailpoint.

#15237 (comment)

@stale
Copy link

stale bot commented May 21, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 21 days if no further activity occurs. Thank you for your contributions.

@preetham
Copy link

@serathius I would like to pick this up, Can you please help me with any information required?

@serathius serathius changed the title Linearizability tests should validate if etcd binary supports gofail Robustness tests should validate if etcd binary supports gofail May 24, 2023
@serathius
Copy link
Member Author

Sure, feel free to reach me on Slack.

@preetham
Copy link

@serathius Can you please check the PR: #15963? Does this line up with the expectation?

@jmhbnz
Copy link
Member

jmhbnz commented Nov 23, 2023

Discussed during sig etcd triage meeting. It's possible this is already resolved via #16698.

Assigned @moficodes to check and close if so.

@moficodes
Copy link
Member

@jmhbnz will take a look Thanks.

@jmhbnz jmhbnz assigned moficodes and unassigned preetham Nov 23, 2023
@moficodes
Copy link
Member

Tried with gofail-disable and build.

Was hoping test-robustness would fail. It did not. Might be doing something wrong.

user@vs-code:~/documents/github.com/moficodes/etcd$ make gofail-disable && make build
cd tools/mod; go install go.etcd.io/gofail@v0.1.0
gofail disable server/etcdserver/ server/storage/backend/ server/storage/mvcc/ server/storage/wal/
cd ./server && go mod tidy
cd ./etcdutl && go mod tidy
cd ./etcdctl && go mod tidy
cd ./tests && go mod tidy
GO_BUILD_FLAGS=" -v -mod=readonly" ./scripts/build.sh
Running etcd_build
% 'rm' '-f' 'bin/etcd'
% (cd server && 'env' 'CGO_ENABLED=0' 'GO_BUILD_FLAGS= -v -mod=readonly' 'GOOS=linux' 'GOARCH=amd64' 'go' 'build' '-v' '-mod=readonly' '-trimpath' '-installsuffix=cgo' '-ldflags=-X=go.etcd.io/etcd/api/v3/version.GitSHA=904c0769e' '-o=../bin/etcd' '.')
% 'rm' '-f' 'bin/etcdutl'
% (cd etcdutl && 'env' 'GO_BUILD_FLAGS= -v -mod=readonly' 'CGO_ENABLED=0' 'GO_BUILD_FLAGS= -v -mod=readonly' 'GOOS=linux' 'GOARCH=amd64' 'go' 'build' '-v' '-mod=readonly' '-trimpath' '-installsuffix=cgo' '-ldflags=-X=go.etcd.io/etcd/api/v3/version.GitSHA=904c0769e' '-o=../bin/etcdutl' '.')
% 'rm' '-f' 'bin/etcdctl'
% (cd etcdctl && 'env' 'GO_BUILD_FLAGS= -v -mod=readonly' 'CGO_ENABLED=0' 'GO_BUILD_FLAGS= -v -mod=readonly' 'GOOS=linux' 'GOARCH=amd64' 'go' 'build' '-v' '-mod=readonly' '-trimpath' '-installsuffix=cgo' '-ldflags=-X=go.etcd.io/etcd/api/v3/version.GitSHA=904c0769e' '-o=../bin/etcdctl' '.')
SUCCESS: etcd_build (GOARCH=amd64)
user@vs-code:~/documents/github.com/moficodes/etcd$ make test-robustness
PASSES="robustness" ./scripts/test.sh 
Running with --race
Starting at: Fri 24 Nov 2023 06:13:55 AM UTC

'robustness' started at Fri 24 Nov 2023 06:13:55 AM UTC
% (cd tests && 'env' 'ETCD_VERIFY=all' 'go' 'test' 'go.etcd.io/etcd/tests/v3/robustness' '-timeout=30m')
ok      go.etcd.io/etcd/tests/v3/robustness     (cached)
'robustness' PASSED and completed at Fri 24 Nov 2023 06:13:59 AM UTC
SUCCESS

@jmhbnz
Copy link
Member

jmhbnz commented Nov 24, 2023

Hey @moficodes - To get robustness tests running you will need to construct a full testing command, something like below for example:

 james  ~  Documents  etcd   main                                                                                                                                              21:13:30 
 ➜ GO_TEST_FLAGS="-v --count 12 --timeout 30m --failfast --run TestRobustness" 
 ➜ ETCD_BRANCH=main EXPECT_DEBUG=true GO_TEST_FLAGS=${GO_TEST_FLAGS} RESULTS_DIR=/tmp/results make test-robustness       

You can see how these test commands are put together looking at the github actions workflow: https://github.com/etcd-io/etcd/blob/main/.github/workflows/robustness-template.yaml

Perhaps in future we could add some sane defaults when running make test-robustness if nothing is provided in advance.

@moficodes
Copy link
Member

@jmhbnz
With gofail disabled test still passed.

ok      go.etcd.io/etcd/tests/v3/robustness     456.528s
'robustness' PASSED and completed at Fri 24 Nov 2023 02:07:55 PM UTC
SUCCESS

@serathius
Copy link
Member Author

Oops, if you run GO_TEST_FLAGS='-v' make test-robustness to get verbose logs:

cluster.go:432: please run 'make gofail-enable && make build' before running the test

@serathius
Copy link
Member Author

#16698 allowed to skip e2e tests when running binary without failpoints.

This is nice for local development, however for CI we should have a way to ensure we run all tests. For example a flag --skip-gofail.

@moficodes
Copy link
Member

@serathius yep. I see the log. I thought it was going to fail the test.

@moficodes
Copy link
Member

@jmhbnz If just the log is intended behavior I can confirm this log print happens.

@jmhbnz
Copy link
Member

jmhbnz commented Jan 4, 2024

Discussed during sig-etcd triage meeting. @serathius can you add some more context here on what the desired next step is?

@serathius
Copy link
Member Author

#16698 Has implemented this issue as a side effect. So I would consider this issue closed. There is one possible followup, with automated test skipping it will be easy to introduce a bug that would unintentionally skip test. We should have some validation in CI or improve visibility into skipped tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants