diff --git a/integration/auth_web_flow_test.go b/integration/auth_web_flow_test.go index 3682ed1e..4c42dfbb 100644 --- a/integration/auth_web_flow_test.go +++ b/integration/auth_web_flow_test.go @@ -147,7 +147,7 @@ func TestAuthWebFlowLogoutAndRelogin(t *testing.T) { } } - scenario.waitForTailscaleLogout() + scenario.WaitForTailscaleLogout() t.Logf("all clients logged out") @@ -259,22 +259,6 @@ func (s *AuthWebFlowScenario) CreateHeadscaleEnv( return nil } -func (s *AuthWebFlowScenario) waitForTailscaleLogout() { - for _, namespace := range s.namespaces { - for _, client := range namespace.Clients { - namespace.syncWaitGroup.Add(1) - - go func(c TailscaleClient) { - defer namespace.syncWaitGroup.Done() - - // TODO(kradalby): error handle this - _ = c.WaitForLogout() - }(client) - } - namespace.syncWaitGroup.Wait() - } -} - func (s *AuthWebFlowScenario) runTailscaleUp( namespaceStr, loginServer string, ) error { diff --git a/integration/scenario.go b/integration/scenario.go index 4a8ee00f..44b5b1ca 100644 --- a/integration/scenario.go +++ b/integration/scenario.go @@ -469,3 +469,19 @@ func (s *Scenario) ListTailscaleClientsFQDNs(namespaces ...string) ([]string, er return allFQDNs, nil } + +func (s *Scenario) WaitForTailscaleLogout() { + for _, namespace := range s.namespaces { + for _, client := range namespace.Clients { + namespace.syncWaitGroup.Add(1) + + go func(c TailscaleClient) { + defer namespace.syncWaitGroup.Done() + + // TODO(kradalby): error handle this + _ = c.WaitForLogout() + }(client) + } + namespace.syncWaitGroup.Wait() + } +}