This commit is contained in:
Shreyas Goenka 2025-02-18 13:16:35 +01:00
parent a4009ed6fa
commit b130787318
No known key found for this signature in database
GPG Key ID: 92A07DF49CCB0622
1 changed files with 8 additions and 1 deletions

View File

@ -10,11 +10,18 @@ import (
"github.com/spf13/cobra"
)
// TODO: Manually test that indeed latency is not added.
func newChildCommand() *cobra.Command {
return &cobra.Command{
Use: "child",
RunE: func(cmd *cobra.Command, args []string) error {
// wait_pid lives in acceptance/bin. We expect this command to only be called
// from acceptance tests.
//
// Note: The golang stdlib only provides a way to wait on processes
// that are children of the current process. While it's possible to
// rely on os native syscalls to wait on arbitrary processes, it's hard
// to get right and unit test. So I opted to just rely on the wait_pid
// script here.
waitCmd := exec.Command("bash", "-euo", "pipefail", "wait_pid", os.Getenv(daemon.DatabricksCliParentPid))
b, err := waitCmd.Output()
if err != nil {