Merge pull request #318 from travisturner/config-cmd

suppress test config arguments from pilosa config output
This commit is contained in:
Travis Turner 2020-04-24 13:23:36 -05:00 committed by GitHub
commit 95d44dce28
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View file

@ -55,6 +55,9 @@ func tExec(t *testing.T, cmd *cobra.Command, out io.Reader, w io.WriteCloser) (o
if err := w.Close(); err != nil {
return output, fmt.Errorf("closing cmd's stdout: %v", err)
}
// NOTE: if cmd.Execute doesn't return, then this select (and
// therefore the one-second timeout, won't be reached)
select {
case <-done:
case <-time.After(time.Second * 1):
@ -64,7 +67,7 @@ func tExec(t *testing.T, cmd *cobra.Command, out io.Reader, w io.WriteCloser) (o
}
// ExecNewRootCommand executes the pilosa root command with the given arguments
// and returns it's output. It will fail if the command does not complete within
// and returns its output. It will fail if the command does not complete within
// 1 second.
func ExecNewRootCommand(t *testing.T, args ...string) (string, error) {
out, w := io.Pipe()

View file

@ -98,14 +98,14 @@ type Config struct {
// intentionally not defined as a flag... only exposed here so
// that we can limit the size while running tests in CI so we
// don't exhaust the goroutine limit.
WorkerPoolSize int
WorkerPoolSize int `toml:"-"`
// ImportWorkerPoolSize controls how many goroutines are created for
// processing importRoaring jobs. Defaults to runtime.NumCPU(). It is
// intentionally not defined as a flag... only exposed here so
// that we can limit the size while running tests in CI so we
// don't exhaust the goroutine limit.
ImportWorkerPoolSize int
ImportWorkerPoolSize int `toml:"-"`
Cluster struct {
// Disabled controls whether clustering functionality is enabled.