Using a WaitGroup makes the pod controller wait for all pod visitors to end before checking for errors. Consequently, If one pod visitor fails (for instance, the agent command fails) the rest of the visitors will not be immediately canceled.
Checklist:
[X] I have performed a self-review of my code
[x] I have commented my code, particularly in hard-to-understand areas
[ ] I have made corresponding changes to the documentation
[x] I have added tests that prove my fix is effective or that my feature works.
[X] I have run linter locally (make lint) and all checks pass.
[X] I have run tests locally (make test) and all tests pass.
[ ] I have run relevant integration test locally (make integration-xxx for affected packages)
[X] I have run relevant e2e test locally (make e2e-xxx for disruptors, or cluster related changes)
[ ] Any dependent changes have been merged and published in downstream modules
Description
After changes introduced in https://github.com/grafana/xk6-disruptor/pull/355 the logic for waiting all pod visitors to finish and report errors was broken.
Using a
WaitGroup
makes the pod controller wait for all pod visitors to end before checking for errors. Consequently, If one pod visitor fails (for instance, the agent command fails) the rest of the visitors will not be immediately canceled.Checklist:
make lint
) and all checks pass.make test
) and all tests pass.make integration-xxx
for affected packages)make e2e-xxx
fordisruptors
, orcluster
related changes)