From cc4bf0fc9fc58da7f4eb522aad3fa41f0f0068f5 Mon Sep 17 00:00:00 2001 From: William Martin Date: Thu, 16 Jan 2025 14:10:42 +0100 Subject: [PATCH] Add small wait to extension update tests --- pkg/cmd/root/extension_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/cmd/root/extension_test.go b/pkg/cmd/root/extension_test.go index 8246c0e2a..5e9e9b9bc 100644 --- a/pkg/cmd/root/extension_test.go +++ b/pkg/cmd/root/extension_test.go @@ -123,6 +123,10 @@ func TestNewCmdExtension_Updates(t *testing.T) { em := &extensions.ExtensionManagerMock{ DispatchFunc: func(args []string, stdin io.Reader, stdout io.Writer, stderr io.Writer) (bool, error) { // Assume extension executed / dispatched without problems as test is focused on upgrade checking. + // Sleep for 100 milliseconds to allow update checking logic to complete. This would be better + // served by making the behaviour controllable by channels, but it's a larger change than desired + // just to improve the test. + time.Sleep(100 * time.Millisecond) return true, nil }, }