Skip to content

praefect: Fix race condition in sub-commands tests

Pavlo Strokov requested to merge ps-prafect-fix-sub-command-flaky-flags into master

The tests for praefect sub-commands run cli during the test. The cli package we use rely on a global flags, like -help and -version. During the execution the default value is set to these flags by the cli package internally. It happens for the same global instance simultaneously in different goroutines it causes a race condition. As a solution the global flag instances are replaced with the stub implementations that does nothing. We do not need these flags in the test. It also doesn't make sense to test it as it is part of the third party package.

Closes: #5080 (closed)

Merge request reports