etcd
etcd copied to clipboard
functional: remove SIGQUIT_ETCD_AND_REMOVE_DATA_AND_STOP_AGENT command
Problem: both SIGQUIT_ETCD_AND_REMOVE_DATA_AND_STOP_AGENT and test.sh will attempt to stop agents and remove directories.
Solution: since test.sh creates directories and starts test, it should be responsible for cleanup.
See https://github.com/etcd-io/etcd/issues/14384
Signed-off-by: Bogdan Kanivets [email protected]
Please read https://github.com/etcd-io/etcd/blob/main/CONTRIBUTING.md#contribution-flow.
@lavacat please fix the fmt pipeline error
It seems that the etcd data directories will never be removed? What will happen if we restart the functional test when it fails?
It seems that the etcd data directories will never be removed? What will happen if we restart the functional test when it fails?
This line in test.sh will remove data dirs at the start of the tests. https://github.com/etcd-io/etcd/blob/main/scripts/test.sh#L159
It seems that the etcd data directories will never be removed? What will happen if we restart the functional test when it fails?
This line in test.sh will remove data dirs at the start of the tests. https://github.com/etcd-io/etcd/blob/main/scripts/test.sh#L159
I am thinking probably it makes more sense to stop etcd and cleanup the data if the test is successful; otherwise keep the data. Proposed changes:
- Update the (*Cluster) Run to return an
error, and TestFunctional sends aOperation_SIGQUIT_ETCD_AND_REMOVE_DATAto theagentif the returned error isnil. - The test may
panic, so you need to userecover()to check whether (*Cluster) Run is successful or not.
This line in test.sh will remove data dirs at the start of the tests. https://github.com/etcd-io/etcd/blob/main/scripts/test.sh#L159
This should be just a remedy instead of a formal solution. Please consider to update this PR per https://github.com/etcd-io/etcd/pull/14387#issuecomment-1248574599
@lavacat It's OK to resolve the comment in a separate PR, so that we can get this one merged firstly. Please let me know whether you want to resolve it in this PR or in a separate PR.
Since there is no response for a long time, so let me merge this PR firstly and take care of the comment in a separate PR.