Add -race Flag to GitHub Action and Fix Data Race in CreateTailscaleNodesInUser (#2038)
* Add -race flag to Makefile and integration tests; fix data race in CreateTailscaleNodesInUser * Fix data race in ExecuteCommand by using local buffers and mutex Signed-off-by: Dongjun Na <kmu5544616@gmail.com> * lint Signed-off-by: Dongjun Na <kmu5544616@gmail.com> --------- Signed-off-by: Dongjun Na <kmu5544616@gmail.com>
This commit is contained in:
parent
7d937c6bd0
commit
e270169c13
3 changed files with 7 additions and 4 deletions
|
@ -25,7 +25,6 @@ type ExecuteCommandOption func(*ExecuteCommandConfig) error
|
|||
func ExecuteCommandTimeout(timeout time.Duration) ExecuteCommandOption {
|
||||
return ExecuteCommandOption(func(conf *ExecuteCommandConfig) error {
|
||||
conf.timeout = timeout
|
||||
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
@ -67,6 +66,7 @@ func ExecuteCommand(
|
|||
StdErr: &stderr,
|
||||
},
|
||||
)
|
||||
|
||||
resultChan <- result{exitCode, err}
|
||||
}()
|
||||
|
||||
|
@ -88,7 +88,6 @@ func ExecuteCommand(
|
|||
|
||||
return stdout.String(), stderr.String(), nil
|
||||
case <-time.After(execConfig.timeout):
|
||||
|
||||
return stdout.String(), stderr.String(), fmt.Errorf("command failed, stderr: %s: %w", stderr.String(), ErrDockertestCommandTimeout)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue