From 92cc3be1ed5c60a3209d55e2558e8be8af094768 Mon Sep 17 00:00:00 2001 From: Nathan Rijksen Date: Thu, 31 Aug 2023 12:02:35 -0700 Subject: [PATCH] Give windows extra time before sending input --- internal/testhelpers/e2e/spawn.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/internal/testhelpers/e2e/spawn.go b/internal/testhelpers/e2e/spawn.go index aaf136eb47..8c9e3ee081 100644 --- a/internal/testhelpers/e2e/spawn.go +++ b/internal/testhelpers/e2e/spawn.go @@ -89,6 +89,15 @@ func (s *SpawnedCmd) ExpectInput(opts ...termtest.SetExpectOpt) error { return s.Expect(expect, opts...) } +func (s *SpawnedCmd) SendLine(value string) error { + if runtime.GOOS == "windows" { + // Work around race condition - on Windows it appears more likely to happen + // https://activestatef.atlassian.net/browse/DX-2171 + time.Sleep(100 * time.Second) + } + return s.TermTest.SendLine(value) +} + func (s *SpawnedCmd) SendEnter() error { return s.SendLine("") }