From a4a6581e94eb673780b514959d3d993076af9d30 Mon Sep 17 00:00:00 2001 From: Andy Gocke Date: Thu, 21 Oct 2021 14:23:12 -0700 Subject: [PATCH 1/2] Up retry for ETXTBSY Still seeing occasional failure in Alpine (https://dev.azure.com/dnceng/public/_build/results?buildId=1434759) so raising the retry time. --- src/installer/tests/TestUtils/Command.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/installer/tests/TestUtils/Command.cs b/src/installer/tests/TestUtils/Command.cs index 096a53dd8302e3..857b24cdff4203 100644 --- a/src/installer/tests/TestUtils/Command.cs +++ b/src/installer/tests/TestUtils/Command.cs @@ -208,9 +208,7 @@ public Command Start() } catch (Win32Exception e) when (i < 3 && e.Message.Contains("Text file busy")) { - // 10 ms is short, but the race we're trying to avoid is in-between - // "fork" and "exec", so it should be fast - Thread.Sleep(10); + Thread.Sleep(50); } } From 633ca7330b4974d7275de656f16c76f877f01e64 Mon Sep 17 00:00:00 2001 From: Andy Gocke Date: Mon, 25 Oct 2021 17:06:27 -0700 Subject: [PATCH 2/2] Linearly scale wait time --- src/installer/tests/TestUtils/Command.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/installer/tests/TestUtils/Command.cs b/src/installer/tests/TestUtils/Command.cs index 857b24cdff4203..91f85be3584324 100644 --- a/src/installer/tests/TestUtils/Command.cs +++ b/src/installer/tests/TestUtils/Command.cs @@ -206,9 +206,9 @@ public Command Start() Process.Start(); break; } - catch (Win32Exception e) when (i < 3 && e.Message.Contains("Text file busy")) + catch (Win32Exception e) when (i < 4 && e.Message.Contains("Text file busy")) { - Thread.Sleep(50); + Thread.Sleep(i * 20); } }