From b130787318b353acab4253db4f570c3e60804e2e Mon Sep 17 00:00:00 2001 From: Shreyas Goenka Date: Tue, 18 Feb 2025 13:16:35 +0100 Subject: [PATCH] - --- cmd/selftest/child.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cmd/selftest/child.go b/cmd/selftest/child.go index 129042dec..b792575e2 100644 --- a/cmd/selftest/child.go +++ b/cmd/selftest/child.go @@ -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 {