From 7f8e4a00cfe3db990fd3278779ecc443c4f01679 Mon Sep 17 00:00:00 2001 From: Evangelink <11340282+Evangelink@users.noreply.github.com> Date: Fri, 22 May 2026 17:26:31 +0200 Subject: [PATCH 1/6] Unify duration parsing across MTP CLI options (#8430) The three duration-style CLI options used inconsistent grammars: * --timeout used a hand-rolled parser that only accepted single-character suffixes (h|m|s) and rejected bare numbers entirely. * --hangdump-timeout and --retry-failed-tests-delay used the shared TimeSpanParser, which accepts long-form suffixes (90min, 1.5hour, 5400seconds), ms/s/m/h/d, and treats bare numbers as milliseconds. Copy-pasting a value across options would silently break: `--timeout 90min` errored while `--hangdump-timeout 90min` worked. `--timeout 200` was rejected; `--retry-failed-tests-delay 200` parsed as 200 ms. And the existing parser silently accepted bogus alphabetic tails (`30monkey` became 30 minutes because the regex's `s?[a-z]*` tail matched and dispatch ran StartsWith("m")). All three options now route through a single parser: * TimeSpanParser regex tightened to an explicit suffix vocabulary (ms|mils?|milliseconds?|s|secs?|seconds?|m|mins?|minutes?|h|hours?|d|days?), so bogus tails like 30monkey are rejected. * New TryParseRequireSuffix overload for callers (i.e. --timeout) that must require an explicit unit; a new TimeSpanDefaultUnit enum lets other callers express their own bare-number default unit. * Suffix dispatch uses OrdinalIgnoreCase so 1H/1M/1D parse correctly. * Number parsing uses InvariantCulture; TimeSpan.From* calls are wrapped so overflow returns false instead of throwing. * --timeout validator also bounds the value to Timer.MaxSupportedTimeout (uint.MaxValue - 1 ms, ~49.7 days) so `--timeout 60d` produces a friendly CLI error instead of crashing inside CancellationTokenSource.CancelAfter. Help text and error messages for all three options now describe the same grammar; XLFs regenerated for Platform, HangDump, and Retry. Behavior changes worth calling out: 1. --timeout is now a strict superset of its previous grammar (long-form suffixes, ms, d now accepted) but rejects -1s, 1e3s, +1s, and .5s (the old float.TryParse accepted those). 2. Bogus suffixes like 30monkey are now hard-rejected on all three options. Previously the regex silently accepted them and dispatched on the first letter. 3. --timeout now validates against Timer.MaxSupportedTimeout. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Resources/ExtensionResources.resx | 7 +- .../Resources/xlf/ExtensionResources.cs.xlf | 9 +- .../Resources/xlf/ExtensionResources.de.xlf | 9 +- .../Resources/xlf/ExtensionResources.es.xlf | 9 +- .../Resources/xlf/ExtensionResources.fr.xlf | 9 +- .../Resources/xlf/ExtensionResources.it.xlf | 9 +- .../Resources/xlf/ExtensionResources.ja.xlf | 9 +- .../Resources/xlf/ExtensionResources.ko.xlf | 9 +- .../Resources/xlf/ExtensionResources.pl.xlf | 9 +- .../xlf/ExtensionResources.pt-BR.xlf | 9 +- .../Resources/xlf/ExtensionResources.ru.xlf | 9 +- .../Resources/xlf/ExtensionResources.tr.xlf | 9 +- .../xlf/ExtensionResources.zh-Hans.xlf | 9 +- .../xlf/ExtensionResources.zh-Hant.xlf | 9 +- .../Resources/ExtensionResources.resx | 4 +- .../Resources/xlf/ExtensionResources.cs.xlf | 8 +- .../Resources/xlf/ExtensionResources.de.xlf | 8 +- .../Resources/xlf/ExtensionResources.es.xlf | 8 +- .../Resources/xlf/ExtensionResources.fr.xlf | 8 +- .../Resources/xlf/ExtensionResources.it.xlf | 8 +- .../Resources/xlf/ExtensionResources.ja.xlf | 8 +- .../Resources/xlf/ExtensionResources.ko.xlf | 8 +- .../Resources/xlf/ExtensionResources.pl.xlf | 8 +- .../xlf/ExtensionResources.pt-BR.xlf | 8 +- .../Resources/xlf/ExtensionResources.ru.xlf | 8 +- .../Resources/xlf/ExtensionResources.tr.xlf | 8 +- .../xlf/ExtensionResources.zh-Hans.xlf | 8 +- .../xlf/ExtensionResources.zh-Hant.xlf | 8 +- .../PlatformCommandLineProvider.cs | 16 +- .../Helpers/TimeSpanParser.cs | 129 ++++++++++++--- .../Hosts/TestHostBuilder.CommonServices.cs | 12 +- .../Resources/PlatformResources.resx | 4 +- .../Resources/xlf/PlatformResources.cs.xlf | 8 +- .../Resources/xlf/PlatformResources.de.xlf | 8 +- .../Resources/xlf/PlatformResources.es.xlf | 8 +- .../Resources/xlf/PlatformResources.fr.xlf | 8 +- .../Resources/xlf/PlatformResources.it.xlf | 8 +- .../Resources/xlf/PlatformResources.ja.xlf | 8 +- .../Resources/xlf/PlatformResources.ko.xlf | 8 +- .../Resources/xlf/PlatformResources.pl.xlf | 8 +- .../Resources/xlf/PlatformResources.pt-BR.xlf | 8 +- .../Resources/xlf/PlatformResources.ru.xlf | 8 +- .../Resources/xlf/PlatformResources.tr.xlf | 8 +- .../xlf/PlatformResources.zh-Hans.xlf | 8 +- .../xlf/PlatformResources.zh-Hant.xlf | 8 +- .../HelpInfoTests.cs | 2 +- .../HelpInfoAllExtensionsTests.cs | 22 ++- .../HelpInfoTests.cs | 4 +- .../TimeoutTests.cs | 54 ++++++- .../Helpers/TimeSpanParserTests.cs | 148 ++++++++++++++++++ 50 files changed, 523 insertions(+), 204 deletions(-) diff --git a/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/ExtensionResources.resx b/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/ExtensionResources.resx index 0f16cef8cd..e725971686 100644 --- a/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/ExtensionResources.resx +++ b/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/ExtensionResources.resx @@ -178,9 +178,12 @@ Disk info: Specify the timeout after which the dump will be generated. The timeout value is specified in one of the following formats: - 1.5h, 1.5hour, 1.5hours, + 500ms, 500mil, 500millisecond, 500milliseconds, + 5400s, 5400sec, 5400second, 5400seconds, 90m, 90min, 90minute, 90minutes, - 5400s, 5400sec, 5400second, 5400seconds. + 1.5h, 1.5hour, 1.5hours, + 1d, 1day, 1days. + A bare number (with no suffix) is interpreted as milliseconds. Default is 30m. diff --git a/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.cs.xlf b/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.cs.xlf index 72873bad49..5700d1852d 100644 --- a/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.cs.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.cs.xlf @@ -94,11 +94,14 @@ Informace o disku: Specify the timeout after which the dump will be generated. The timeout value is specified in one of the following formats: - 1.5h, 1.5hour, 1.5hours, + 500ms, 500mil, 500millisecond, 500milliseconds, + 5400s, 5400sec, 5400second, 5400seconds, 90m, 90min, 90minute, 90minutes, - 5400s, 5400sec, 5400second, 5400seconds. + 1.5h, 1.5hour, 1.5hours, + 1d, 1day, 1days. + A bare number (with no suffix) is interpreted as milliseconds. Default is 30m. - Zadejte časový limit, po kterém bude vygenerován výpis paměti. + Zadejte časový limit, po kterém bude vygenerován výpis paměti. Hodnota časového limitu se zadává v jednom z následujících formátů: 1.5h, 1.5hour, 1.5hours, 90m, 90min, 90minute, 90minutes, diff --git a/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.de.xlf b/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.de.xlf index 6296088253..8ebe9d43e5 100644 --- a/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.de.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.de.xlf @@ -94,11 +94,14 @@ Datenträgerinformationen: Specify the timeout after which the dump will be generated. The timeout value is specified in one of the following formats: - 1.5h, 1.5hour, 1.5hours, + 500ms, 500mil, 500millisecond, 500milliseconds, + 5400s, 5400sec, 5400second, 5400seconds, 90m, 90min, 90minute, 90minutes, - 5400s, 5400sec, 5400second, 5400seconds. + 1.5h, 1.5hour, 1.5hours, + 1d, 1day, 1days. + A bare number (with no suffix) is interpreted as milliseconds. Default is 30m. - Geben Sie das Timeout an, nach dem das Speicherabbild generiert wird. + Geben Sie das Timeout an, nach dem das Speicherabbild generiert wird. Der Timeoutwert wird in einem der folgenden Formate angegeben: 1,5 h, 1,5 Stunde, 1,5 Stunden, 90 m, 90 Min., 90 Minute, 90 Minuten, diff --git a/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.es.xlf b/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.es.xlf index 18c5ee1b9a..0ad496278c 100644 --- a/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.es.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.es.xlf @@ -94,11 +94,14 @@ Información del disco: Specify the timeout after which the dump will be generated. The timeout value is specified in one of the following formats: - 1.5h, 1.5hour, 1.5hours, + 500ms, 500mil, 500millisecond, 500milliseconds, + 5400s, 5400sec, 5400second, 5400seconds, 90m, 90min, 90minute, 90minutes, - 5400s, 5400sec, 5400second, 5400seconds. + 1.5h, 1.5hour, 1.5hours, + 1d, 1day, 1days. + A bare number (with no suffix) is interpreted as milliseconds. Default is 30m. - Especifique el tiempo de espera después del cual se generará el volcado. + Especifique el tiempo de espera después del cual se generará el volcado. El valor de tiempo de espera se especifica en uno de los formatos siguientes: 1,5 h, 1,5 hora, 1,5 horas, 90 m, 90 min, 90 minuto, 90 minutos, diff --git a/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.fr.xlf b/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.fr.xlf index 6618c85cc9..61ae051aee 100644 --- a/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.fr.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.fr.xlf @@ -94,11 +94,14 @@ Informations sur le risque : Specify the timeout after which the dump will be generated. The timeout value is specified in one of the following formats: - 1.5h, 1.5hour, 1.5hours, + 500ms, 500mil, 500millisecond, 500milliseconds, + 5400s, 5400sec, 5400second, 5400seconds, 90m, 90min, 90minute, 90minutes, - 5400s, 5400sec, 5400second, 5400seconds. + 1.5h, 1.5hour, 1.5hours, + 1d, 1day, 1days. + A bare number (with no suffix) is interpreted as milliseconds. Default is 30m. - Spécifiez le délai d'attente après lequel le vidage sera généré. + Spécifiez le délai d'attente après lequel le vidage sera généré. La valeur du délai d'expiration est spécifiée dans l'un des formats suivants : 1h30, 1h30, 1h30, 90 minutes, 90 minutes, 90 minutes, 90 minutes, diff --git a/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.it.xlf b/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.it.xlf index e7da367e4a..7eefb27cb6 100644 --- a/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.it.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.it.xlf @@ -94,11 +94,14 @@ Informazioni sul disco: Specify the timeout after which the dump will be generated. The timeout value is specified in one of the following formats: - 1.5h, 1.5hour, 1.5hours, + 500ms, 500mil, 500millisecond, 500milliseconds, + 5400s, 5400sec, 5400second, 5400seconds, 90m, 90min, 90minute, 90minutes, - 5400s, 5400sec, 5400second, 5400seconds. + 1.5h, 1.5hour, 1.5hours, + 1d, 1day, 1days. + A bare number (with no suffix) is interpreted as milliseconds. Default is 30m. - Specificare il timeout dopo il quale verrà generato il dump. + Specificare il timeout dopo il quale verrà generato il dump. Il valore del timeout è specificato in uno dei formati seguenti: 1.5h, 1.5hour, 1.5hours, 90m, 90min, 90minute, 90minutes, diff --git a/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.ja.xlf b/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.ja.xlf index 0640c8ec60..ab4f66dc57 100644 --- a/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.ja.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.ja.xlf @@ -94,11 +94,14 @@ Disk info: Specify the timeout after which the dump will be generated. The timeout value is specified in one of the following formats: - 1.5h, 1.5hour, 1.5hours, + 500ms, 500mil, 500millisecond, 500milliseconds, + 5400s, 5400sec, 5400second, 5400seconds, 90m, 90min, 90minute, 90minutes, - 5400s, 5400sec, 5400second, 5400seconds. + 1.5h, 1.5hour, 1.5hours, + 1d, 1day, 1days. + A bare number (with no suffix) is interpreted as milliseconds. Default is 30m. - ダンプが生成されるまでのタイムアウトを指定します。 + ダンプが生成されるまでのタイムアウトを指定します。 タイムアウト値は、次のいずれかの形式で指定されます: 1.5h、1.5hour、1.5hours、 90m、90min、90minute、90minutes、 diff --git a/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.ko.xlf b/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.ko.xlf index f590370ae0..dd2ea6f834 100644 --- a/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.ko.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.ko.xlf @@ -94,11 +94,14 @@ Disk info: Specify the timeout after which the dump will be generated. The timeout value is specified in one of the following formats: - 1.5h, 1.5hour, 1.5hours, + 500ms, 500mil, 500millisecond, 500milliseconds, + 5400s, 5400sec, 5400second, 5400seconds, 90m, 90min, 90minute, 90minutes, - 5400s, 5400sec, 5400second, 5400seconds. + 1.5h, 1.5hour, 1.5hours, + 1d, 1day, 1days. + A bare number (with no suffix) is interpreted as milliseconds. Default is 30m. - 덤프가 생성될 시간 제한을 지정합니다. + 덤프가 생성될 시간 제한을 지정합니다. 시간 제한 값은 다음 형식 중 하나로 지정됩니다. 1.5시간, 1.5시간, 1.5시간, 90m, 90분, 90분, 90분, diff --git a/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.pl.xlf b/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.pl.xlf index 4cf1b7fade..3ac7a070bd 100644 --- a/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.pl.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.pl.xlf @@ -94,11 +94,14 @@ Informacje o dysku: Specify the timeout after which the dump will be generated. The timeout value is specified in one of the following formats: - 1.5h, 1.5hour, 1.5hours, + 500ms, 500mil, 500millisecond, 500milliseconds, + 5400s, 5400sec, 5400second, 5400seconds, 90m, 90min, 90minute, 90minutes, - 5400s, 5400sec, 5400second, 5400seconds. + 1.5h, 1.5hour, 1.5hours, + 1d, 1day, 1days. + A bare number (with no suffix) is interpreted as milliseconds. Default is 30m. - Określ limit czasu, po którym zostanie wygenerowany zrzut. + Określ limit czasu, po którym zostanie wygenerowany zrzut. Wartość limitu czasu jest określana w jednym z następujących formatów: 1.5h, 1.5hour, 1.5hours, 90m, 90min, 90minute, 90minutes, diff --git a/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.pt-BR.xlf b/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.pt-BR.xlf index ec0ba6e4dd..5315d1c96d 100644 --- a/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.pt-BR.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.pt-BR.xlf @@ -94,11 +94,14 @@ Informações do disco: Specify the timeout after which the dump will be generated. The timeout value is specified in one of the following formats: - 1.5h, 1.5hour, 1.5hours, + 500ms, 500mil, 500millisecond, 500milliseconds, + 5400s, 5400sec, 5400second, 5400seconds, 90m, 90min, 90minute, 90minutes, - 5400s, 5400sec, 5400second, 5400seconds. + 1.5h, 1.5hour, 1.5hours, + 1d, 1day, 1days. + A bare number (with no suffix) is interpreted as milliseconds. Default is 30m. - Especifique o tempo limite após o qual o despejo será gerado. + Especifique o tempo limite após o qual o despejo será gerado. O valor de tempo limite é especificado em um dos seguintes formatos: 1,5h, 1,5hora, 1,5horas, 90m, 90min, 90minutos, 90 minutos, diff --git a/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.ru.xlf b/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.ru.xlf index 90a775ca3f..1d404381e5 100644 --- a/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.ru.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.ru.xlf @@ -94,11 +94,14 @@ Disk info: Specify the timeout after which the dump will be generated. The timeout value is specified in one of the following formats: - 1.5h, 1.5hour, 1.5hours, + 500ms, 500mil, 500millisecond, 500milliseconds, + 5400s, 5400sec, 5400second, 5400seconds, 90m, 90min, 90minute, 90minutes, - 5400s, 5400sec, 5400second, 5400seconds. + 1.5h, 1.5hour, 1.5hours, + 1d, 1day, 1days. + A bare number (with no suffix) is interpreted as milliseconds. Default is 30m. - Укажите время ожидания, по истечении которого будет создан дамп. + Укажите время ожидания, по истечении которого будет создан дамп. Значение времени ожидания задано в одном из следующих форматов: 1,5 ч, 1,5 ч, 1,5 часа, 90 м, 90 мин, 90 минут, 90 минут, diff --git a/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.tr.xlf b/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.tr.xlf index e55b8a5f66..a2a211fa5c 100644 --- a/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.tr.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.tr.xlf @@ -94,11 +94,14 @@ Disk bilgileri: Specify the timeout after which the dump will be generated. The timeout value is specified in one of the following formats: - 1.5h, 1.5hour, 1.5hours, + 500ms, 500mil, 500millisecond, 500milliseconds, + 5400s, 5400sec, 5400second, 5400seconds, 90m, 90min, 90minute, 90minutes, - 5400s, 5400sec, 5400second, 5400seconds. + 1.5h, 1.5hour, 1.5hours, + 1d, 1day, 1days. + A bare number (with no suffix) is interpreted as milliseconds. Default is 30m. - Dökümün oluşturulacağı zaman aşımını belirtin. + Dökümün oluşturulacağı zaman aşımını belirtin. Zaman aşımı değeri, aşağıdaki biçimlerden biri ile belirtilir: 1,5 sa, 1,5 saat, 1,5 saat, 90 dk, 90 dak, 90 dakika, 90 dakika, diff --git a/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.zh-Hans.xlf b/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.zh-Hans.xlf index c3b1170bf1..bb59c2a2a1 100644 --- a/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.zh-Hans.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.zh-Hans.xlf @@ -94,11 +94,14 @@ Disk info: Specify the timeout after which the dump will be generated. The timeout value is specified in one of the following formats: - 1.5h, 1.5hour, 1.5hours, + 500ms, 500mil, 500millisecond, 500milliseconds, + 5400s, 5400sec, 5400second, 5400seconds, 90m, 90min, 90minute, 90minutes, - 5400s, 5400sec, 5400second, 5400seconds. + 1.5h, 1.5hour, 1.5hours, + 1d, 1day, 1days. + A bare number (with no suffix) is interpreted as milliseconds. Default is 30m. - 指定生成转储后的超时。 + 指定生成转储后的超时。 超时值按以下格式之一指定: 1.5h、1.5hour、1.5hours、 90m、90min、90minute、90minutes、 diff --git a/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.zh-Hant.xlf b/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.zh-Hant.xlf index 49590e4e13..4e8f5de398 100644 --- a/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.zh-Hant.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.zh-Hant.xlf @@ -94,11 +94,14 @@ Disk info: Specify the timeout after which the dump will be generated. The timeout value is specified in one of the following formats: - 1.5h, 1.5hour, 1.5hours, + 500ms, 500mil, 500millisecond, 500milliseconds, + 5400s, 5400sec, 5400second, 5400seconds, 90m, 90min, 90minute, 90minutes, - 5400s, 5400sec, 5400second, 5400seconds. + 1.5h, 1.5hour, 1.5hours, + 1d, 1day, 1days. + A bare number (with no suffix) is interpreted as milliseconds. Default is 30m. - 指定產生傾印前的逾時時間。 + 指定產生傾印前的逾時時間。 以下欄其中一種格式指定逾時值: 1.5 小時,1.5 小時,1.5 小時, 90 分鐘、90 分鐘、90 分鐘、90 分鐘、 diff --git a/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/ExtensionResources.resx b/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/ExtensionResources.resx index c5b40bb631..e0d9111c22 100644 --- a/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/ExtensionResources.resx +++ b/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/ExtensionResources.resx @@ -165,10 +165,10 @@ Moving last attempt asset files to the default result directory Retry failed tests feature is not supported in server mode - Add a delay between retries. The delay is expressed as a time value, e.g. 200, 1s, 2.5m, 1h. Default unit is milliseconds. + Add a delay between retries. The delay is expressed as a time value, e.g. 200, 500ms, 1s, 2.5m, 1h, 1d. Default unit is milliseconds. - Option '--retry-failed-tests-delay' requires a valid time span value that is non-negative and no greater than 2147483647ms (~24.20:31:23.647) (e.g. 200, 1s, 2.5m, 1h) + Option '--retry-failed-tests-delay' requires a valid time span value that is non-negative and no greater than 2147483647ms (~24.20:31:23.647) (e.g. 200, 500ms, 1s, 2.5m, 1h, 1d) Retry failed tests the given number of times diff --git a/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.cs.xlf b/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.cs.xlf index 7766a8cbe3..802c51712e 100644 --- a/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.cs.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.cs.xlf @@ -51,13 +51,13 @@ Přesouvání souborů prostředků posledního pokusu do výchozího adresáře - Add a delay between retries. The delay is expressed as a time value, e.g. 200, 1s, 2.5m, 1h. Default unit is milliseconds. - Umožňuje přidat prodlevu mezi opakovanými pokusy. Prodleva je vyjádřena jako časová hodnota, např. 200, 1s, 2.5m, 1h. Výchozí jednotkou jsou milisekundy. + Add a delay between retries. The delay is expressed as a time value, e.g. 200, 500ms, 1s, 2.5m, 1h, 1d. Default unit is milliseconds. + Umožňuje přidat prodlevu mezi opakovanými pokusy. Prodleva je vyjádřena jako časová hodnota, např. 200, 1s, 2.5m, 1h. Výchozí jednotkou jsou milisekundy. - Option '--retry-failed-tests-delay' requires a valid time span value that is non-negative and no greater than 2147483647ms (~24.20:31:23.647) (e.g. 200, 1s, 2.5m, 1h) - Možnost --retry-failed-tests-delay vyžaduje platnou hodnotu časového rozsahu, která není záporná a není větší než 2147483647 ms (~24.20:31:23.647) (například 200, 1s, 2.5m, 1h). + Option '--retry-failed-tests-delay' requires a valid time span value that is non-negative and no greater than 2147483647ms (~24.20:31:23.647) (e.g. 200, 500ms, 1s, 2.5m, 1h, 1d) + Možnost --retry-failed-tests-delay vyžaduje platnou hodnotu časového rozsahu, která není záporná a není větší než 2147483647 ms (~24.20:31:23.647) (například 200, 1s, 2.5m, 1h). diff --git a/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.de.xlf b/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.de.xlf index 8338fdfefd..14c418425a 100644 --- a/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.de.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.de.xlf @@ -51,13 +51,13 @@ Medienobjektdateien des letzten Versuchs werden in das Standardergebnisverzeichn - Add a delay between retries. The delay is expressed as a time value, e.g. 200, 1s, 2.5m, 1h. Default unit is milliseconds. - Fügen Sie eine Verzögerung zwischen den Wiederholungen hinzu. Die Verzögerung wird als Zeitwert ausgedrückt, z. B. 200, 1 s, 2,5 m, 1 h. Die Standardeinheit ist Millisekunden (ms). + Add a delay between retries. The delay is expressed as a time value, e.g. 200, 500ms, 1s, 2.5m, 1h, 1d. Default unit is milliseconds. + Fügen Sie eine Verzögerung zwischen den Wiederholungen hinzu. Die Verzögerung wird als Zeitwert ausgedrückt, z. B. 200, 1 s, 2,5 m, 1 h. Die Standardeinheit ist Millisekunden (ms). - Option '--retry-failed-tests-delay' requires a valid time span value that is non-negative and no greater than 2147483647ms (~24.20:31:23.647) (e.g. 200, 1s, 2.5m, 1h) - Die Option „--retry-failed-tests-delay“ erfordert einen gültigen Zeitbereichswert, der nicht negativ und nicht größer als 2147483647 ms (~24,20:31:23.647) ist (z. B. 200, 1 s., 2,5 m, 1 h). + Option '--retry-failed-tests-delay' requires a valid time span value that is non-negative and no greater than 2147483647ms (~24.20:31:23.647) (e.g. 200, 500ms, 1s, 2.5m, 1h, 1d) + Die Option „--retry-failed-tests-delay“ erfordert einen gültigen Zeitbereichswert, der nicht negativ und nicht größer als 2147483647 ms (~24,20:31:23.647) ist (z. B. 200, 1 s., 2,5 m, 1 h). diff --git a/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.es.xlf b/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.es.xlf index 9e2c9e6f6b..2ae3fbc1d1 100644 --- a/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.es.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.es.xlf @@ -51,13 +51,13 @@ Moviendo los archivos de recursos del último intento al directorio de resultado - Add a delay between retries. The delay is expressed as a time value, e.g. 200, 1s, 2.5m, 1h. Default unit is milliseconds. - Agregue un retraso entre reintentos. El retraso se expresa como un valor de tiempo, por ejemplo, 200, 1s, 2,5 m, 1h. La unidad predeterminada es milisegundos. + Add a delay between retries. The delay is expressed as a time value, e.g. 200, 500ms, 1s, 2.5m, 1h, 1d. Default unit is milliseconds. + Agregue un retraso entre reintentos. El retraso se expresa como un valor de tiempo, por ejemplo, 200, 1s, 2,5 m, 1h. La unidad predeterminada es milisegundos. - Option '--retry-failed-tests-delay' requires a valid time span value that is non-negative and no greater than 2147483647ms (~24.20:31:23.647) (e.g. 200, 1s, 2.5m, 1h) - La opción "--retry-failed-tests-delay" requiere un valor de intervalo de tiempo válido, que no sea negativo y no sea mayor que 2147483647 ms (~24.20:31:23.647) (por ejemplo, 200, 1 s, 2,5 m, 1 h) + Option '--retry-failed-tests-delay' requires a valid time span value that is non-negative and no greater than 2147483647ms (~24.20:31:23.647) (e.g. 200, 500ms, 1s, 2.5m, 1h, 1d) + La opción "--retry-failed-tests-delay" requiere un valor de intervalo de tiempo válido, que no sea negativo y no sea mayor que 2147483647 ms (~24.20:31:23.647) (por ejemplo, 200, 1 s, 2,5 m, 1 h) diff --git a/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.fr.xlf b/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.fr.xlf index f55ce3a551..6d7ab04792 100644 --- a/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.fr.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.fr.xlf @@ -51,13 +51,13 @@ Déplacement des fichiers de ressources de la dernière tentative vers le réper - Add a delay between retries. The delay is expressed as a time value, e.g. 200, 1s, 2.5m, 1h. Default unit is milliseconds. - Ajoutez un délai entre les nouvelles tentatives. Le délai s’exprime sous forme de durée, par exemple 200, 1 s, 2,5 m, 1 h. L’unité par défaut est la milliseconde. + Add a delay between retries. The delay is expressed as a time value, e.g. 200, 500ms, 1s, 2.5m, 1h, 1d. Default unit is milliseconds. + Ajoutez un délai entre les nouvelles tentatives. Le délai s’exprime sous forme de durée, par exemple 200, 1 s, 2,5 m, 1 h. L’unité par défaut est la milliseconde. - Option '--retry-failed-tests-delay' requires a valid time span value that is non-negative and no greater than 2147483647ms (~24.20:31:23.647) (e.g. 200, 1s, 2.5m, 1h) - L’option « --retry-failed-tests-delay » requiert une valeur d’intervalle de temps valide, non négative et inférieure ou égale à 2147483647 ms (~24.20:31:23.647) (par exemple 200, 1 s, 2,5 m, 1 h) + Option '--retry-failed-tests-delay' requires a valid time span value that is non-negative and no greater than 2147483647ms (~24.20:31:23.647) (e.g. 200, 500ms, 1s, 2.5m, 1h, 1d) + L’option « --retry-failed-tests-delay » requiert une valeur d’intervalle de temps valide, non négative et inférieure ou égale à 2147483647 ms (~24.20:31:23.647) (par exemple 200, 1 s, 2,5 m, 1 h) diff --git a/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.it.xlf b/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.it.xlf index e584e58cc5..fc1b2dc66c 100644 --- a/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.it.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.it.xlf @@ -51,13 +51,13 @@ Spostamento dei file di asset dell'ultimo tentativo nella directory dei risultat - Add a delay between retries. The delay is expressed as a time value, e.g. 200, 1s, 2.5m, 1h. Default unit is milliseconds. - Aggiungi il ritardo tra i tentativi. Il ritardo è espresso come valore temporale, ad esempio 200, 1s, 2,5m, 1h. L'unità predefinita è il millisecondo. + Add a delay between retries. The delay is expressed as a time value, e.g. 200, 500ms, 1s, 2.5m, 1h, 1d. Default unit is milliseconds. + Aggiungi il ritardo tra i tentativi. Il ritardo è espresso come valore temporale, ad esempio 200, 1s, 2,5m, 1h. L'unità predefinita è il millisecondo. - Option '--retry-failed-tests-delay' requires a valid time span value that is non-negative and no greater than 2147483647ms (~24.20:31:23.647) (e.g. 200, 1s, 2.5m, 1h) - L'opzione '--retry-failed-tests-delay' richiede un valore di intervallo di tempo valido, non negativo e non superiore a 2147483647ms (~24.20:31:23.647) (ad esempio 200, 1s, 2.5m, 1h) + Option '--retry-failed-tests-delay' requires a valid time span value that is non-negative and no greater than 2147483647ms (~24.20:31:23.647) (e.g. 200, 500ms, 1s, 2.5m, 1h, 1d) + L'opzione '--retry-failed-tests-delay' richiede un valore di intervallo di tempo valido, non negativo e non superiore a 2147483647ms (~24.20:31:23.647) (ad esempio 200, 1s, 2.5m, 1h) diff --git a/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.ja.xlf b/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.ja.xlf index 7e6176a2a1..1f3b419e45 100644 --- a/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.ja.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.ja.xlf @@ -51,13 +51,13 @@ Moving last attempt asset files to the default result directory - Add a delay between retries. The delay is expressed as a time value, e.g. 200, 1s, 2.5m, 1h. Default unit is milliseconds. - 再試行の間に遅延を追加します。遅延は、200、1s、2.5m、1h などの時間値として表されます。既定の単位はミリ秒です。 + Add a delay between retries. The delay is expressed as a time value, e.g. 200, 500ms, 1s, 2.5m, 1h, 1d. Default unit is milliseconds. + 再試行の間に遅延を追加します。遅延は、200、1s、2.5m、1h などの時間値として表されます。既定の単位はミリ秒です。 - Option '--retry-failed-tests-delay' requires a valid time span value that is non-negative and no greater than 2147483647ms (~24.20:31:23.647) (e.g. 200, 1s, 2.5m, 1h) - オプション '--retry-failed-tests-delay' には、2147483647 ミリ秒 (~24.20:31:23.647) (例: 200、1s、2.5m、1h) を超えない有効なタイム スパン値が必要です + Option '--retry-failed-tests-delay' requires a valid time span value that is non-negative and no greater than 2147483647ms (~24.20:31:23.647) (e.g. 200, 500ms, 1s, 2.5m, 1h, 1d) + オプション '--retry-failed-tests-delay' には、2147483647 ミリ秒 (~24.20:31:23.647) (例: 200、1s、2.5m、1h) を超えない有効なタイム スパン値が必要です diff --git a/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.ko.xlf b/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.ko.xlf index 0058c174fb..9f49018453 100644 --- a/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.ko.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.ko.xlf @@ -51,13 +51,13 @@ Moving last attempt asset files to the default result directory - Add a delay between retries. The delay is expressed as a time value, e.g. 200, 1s, 2.5m, 1h. Default unit is milliseconds. - 재시도 간 지연을 추가합니다. 지연은 시간 값으로 표현됩니다(예: 200, 1s, 2.5m, 1h). 기본 단위는 밀리초입니다. + Add a delay between retries. The delay is expressed as a time value, e.g. 200, 500ms, 1s, 2.5m, 1h, 1d. Default unit is milliseconds. + 재시도 간 지연을 추가합니다. 지연은 시간 값으로 표현됩니다(예: 200, 1s, 2.5m, 1h). 기본 단위는 밀리초입니다. - Option '--retry-failed-tests-delay' requires a valid time span value that is non-negative and no greater than 2147483647ms (~24.20:31:23.647) (e.g. 200, 1s, 2.5m, 1h) - '--retry-failed-tests-delay' 옵션에는 음수가 아닌 2147483647ms(~24.20:31:23.647) 이하인 유효한 시간 범위 값이 필요합니다(예: 200, 1s, 2.5m, 1h) + Option '--retry-failed-tests-delay' requires a valid time span value that is non-negative and no greater than 2147483647ms (~24.20:31:23.647) (e.g. 200, 500ms, 1s, 2.5m, 1h, 1d) + '--retry-failed-tests-delay' 옵션에는 음수가 아닌 2147483647ms(~24.20:31:23.647) 이하인 유효한 시간 범위 값이 필요합니다(예: 200, 1s, 2.5m, 1h) diff --git a/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.pl.xlf b/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.pl.xlf index 83099ad314..9cceefe847 100644 --- a/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.pl.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.pl.xlf @@ -51,13 +51,13 @@ Przeniesienie plików zasobów ostatniej próby do domyślnego katalogu wyników - Add a delay between retries. The delay is expressed as a time value, e.g. 200, 1s, 2.5m, 1h. Default unit is milliseconds. - Opóźnienie między ponownymi próbami. Opóźnienie jest wyrażane jako wartość czasu, np. 200, 1 s, 2,5 min, 1 godz. Jednostka domyślna to milisekundy. + Add a delay between retries. The delay is expressed as a time value, e.g. 200, 500ms, 1s, 2.5m, 1h, 1d. Default unit is milliseconds. + Opóźnienie między ponownymi próbami. Opóźnienie jest wyrażane jako wartość czasu, np. 200, 1 s, 2,5 min, 1 godz. Jednostka domyślna to milisekundy. - Option '--retry-failed-tests-delay' requires a valid time span value that is non-negative and no greater than 2147483647ms (~24.20:31:23.647) (e.g. 200, 1s, 2.5m, 1h) - Opcja „--retry-failed-tests-delay” wymaga prawidłowej wartości przedziału czasu nieujemnej i nie większej niż 2147483647 ms (~24.20:31:23.647) (np. 200, 1 s, 2,5 min, 1 godz.) + Option '--retry-failed-tests-delay' requires a valid time span value that is non-negative and no greater than 2147483647ms (~24.20:31:23.647) (e.g. 200, 500ms, 1s, 2.5m, 1h, 1d) + Opcja „--retry-failed-tests-delay” wymaga prawidłowej wartości przedziału czasu nieujemnej i nie większej niż 2147483647 ms (~24.20:31:23.647) (np. 200, 1 s, 2,5 min, 1 godz.) diff --git a/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.pt-BR.xlf b/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.pt-BR.xlf index 240b9dba3d..16669fcc4f 100644 --- a/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.pt-BR.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.pt-BR.xlf @@ -51,13 +51,13 @@ Movendo arquivos de ativo da última tentativa para o diretório de resultados p - Add a delay between retries. The delay is expressed as a time value, e.g. 200, 1s, 2.5m, 1h. Default unit is milliseconds. - Adicione um atraso entre as repetições. O atraso é expresso como um valor de tempo, por exemplo, 200, 1s, 2,5 m, 1h. A unidade padrão é de milissegundos. + Add a delay between retries. The delay is expressed as a time value, e.g. 200, 500ms, 1s, 2.5m, 1h, 1d. Default unit is milliseconds. + Adicione um atraso entre as repetições. O atraso é expresso como um valor de tempo, por exemplo, 200, 1s, 2,5 m, 1h. A unidade padrão é de milissegundos. - Option '--retry-failed-tests-delay' requires a valid time span value that is non-negative and no greater than 2147483647ms (~24.20:31:23.647) (e.g. 200, 1s, 2.5m, 1h) - A opção '--retry-failed-tests-delay' requer um valor de intervalo de tempo válido que não seja negativo e não maior que 2147483647 ms (~24,20:31:23.647) (por exemplo, 200, 1s, 2,5 m, 1h) + Option '--retry-failed-tests-delay' requires a valid time span value that is non-negative and no greater than 2147483647ms (~24.20:31:23.647) (e.g. 200, 500ms, 1s, 2.5m, 1h, 1d) + A opção '--retry-failed-tests-delay' requer um valor de intervalo de tempo válido que não seja negativo e não maior que 2147483647 ms (~24,20:31:23.647) (por exemplo, 200, 1s, 2,5 m, 1h) diff --git a/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.ru.xlf b/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.ru.xlf index ff7be3d790..3bce2f7616 100644 --- a/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.ru.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.ru.xlf @@ -51,13 +51,13 @@ Moving last attempt asset files to the default result directory - Add a delay between retries. The delay is expressed as a time value, e.g. 200, 1s, 2.5m, 1h. Default unit is milliseconds. - Добавьте задержку между повторными попытками. Задержка выражается значением времени, например, 200, 1 с, 2,5 мин, 1 ч. Единица измерения по умолчанию: миллисекунды. + Add a delay between retries. The delay is expressed as a time value, e.g. 200, 500ms, 1s, 2.5m, 1h, 1d. Default unit is milliseconds. + Добавьте задержку между повторными попытками. Задержка выражается значением времени, например, 200, 1 с, 2,5 мин, 1 ч. Единица измерения по умолчанию: миллисекунды. - Option '--retry-failed-tests-delay' requires a valid time span value that is non-negative and no greater than 2147483647ms (~24.20:31:23.647) (e.g. 200, 1s, 2.5m, 1h) - Параметр "--retry-failed-tests-delay" требует допустимое значение диапазона времени: неотрицательное и не больше 2147483647 мс (~24.20:31:23.647) (например, 200, 1 с, 2,5 мин, 1 ч) + Option '--retry-failed-tests-delay' requires a valid time span value that is non-negative and no greater than 2147483647ms (~24.20:31:23.647) (e.g. 200, 500ms, 1s, 2.5m, 1h, 1d) + Параметр "--retry-failed-tests-delay" требует допустимое значение диапазона времени: неотрицательное и не больше 2147483647 мс (~24.20:31:23.647) (например, 200, 1 с, 2,5 мин, 1 ч) diff --git a/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.tr.xlf b/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.tr.xlf index 45f4dc09d9..541858782a 100644 --- a/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.tr.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.tr.xlf @@ -51,13 +51,13 @@ Son deneme varlık dosyaları, varsayılan sonuç dizinine taşınıyor - Add a delay between retries. The delay is expressed as a time value, e.g. 200, 1s, 2.5m, 1h. Default unit is milliseconds. - Yeniden denemeler arasına gecikme süresi ekleyin. Gecikme süresi bir zaman değeri olarak ifade edilir. Örneğin 200, 1s, 2.5m, 1h. Varsayılan birim milisaniyedir. + Add a delay between retries. The delay is expressed as a time value, e.g. 200, 500ms, 1s, 2.5m, 1h, 1d. Default unit is milliseconds. + Yeniden denemeler arasına gecikme süresi ekleyin. Gecikme süresi bir zaman değeri olarak ifade edilir. Örneğin 200, 1s, 2.5m, 1h. Varsayılan birim milisaniyedir. - Option '--retry-failed-tests-delay' requires a valid time span value that is non-negative and no greater than 2147483647ms (~24.20:31:23.647) (e.g. 200, 1s, 2.5m, 1h) - '--retry-failed-tests-delay' seçeneği için negatif olmayan ve 2147483647ms'yi (~24.20:31:23.647) aşmayan geçerli bir zaman aralığı değeri gerekir (örneğin 200, 1s, 2.5m, 1h) + Option '--retry-failed-tests-delay' requires a valid time span value that is non-negative and no greater than 2147483647ms (~24.20:31:23.647) (e.g. 200, 500ms, 1s, 2.5m, 1h, 1d) + '--retry-failed-tests-delay' seçeneği için negatif olmayan ve 2147483647ms'yi (~24.20:31:23.647) aşmayan geçerli bir zaman aralığı değeri gerekir (örneğin 200, 1s, 2.5m, 1h) diff --git a/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.zh-Hans.xlf b/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.zh-Hans.xlf index 18df966e71..9eaed7ec0f 100644 --- a/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.zh-Hans.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.zh-Hans.xlf @@ -51,13 +51,13 @@ Moving last attempt asset files to the default result directory - Add a delay between retries. The delay is expressed as a time value, e.g. 200, 1s, 2.5m, 1h. Default unit is milliseconds. - 在重试之间添加延迟。延迟以时间值表示,例如 200、1s、2.5m、1h。默认单位为毫秒。 + Add a delay between retries. The delay is expressed as a time value, e.g. 200, 500ms, 1s, 2.5m, 1h, 1d. Default unit is milliseconds. + 在重试之间添加延迟。延迟以时间值表示,例如 200、1s、2.5m、1h。默认单位为毫秒。 - Option '--retry-failed-tests-delay' requires a valid time span value that is non-negative and no greater than 2147483647ms (~24.20:31:23.647) (e.g. 200, 1s, 2.5m, 1h) - 选项 "--retry-failed-tests-delay" 需要有效的非负时间范围值,且不大于 2147483647 毫秒(约 24.20:31:23.647),例如 200、1s、2.5m、1h + Option '--retry-failed-tests-delay' requires a valid time span value that is non-negative and no greater than 2147483647ms (~24.20:31:23.647) (e.g. 200, 500ms, 1s, 2.5m, 1h, 1d) + 选项 "--retry-failed-tests-delay" 需要有效的非负时间范围值,且不大于 2147483647 毫秒(约 24.20:31:23.647),例如 200、1s、2.5m、1h diff --git a/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.zh-Hant.xlf b/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.zh-Hant.xlf index 243306f5cb..40b9b61a87 100644 --- a/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.zh-Hant.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.Retry/Resources/xlf/ExtensionResources.zh-Hant.xlf @@ -51,13 +51,13 @@ Moving last attempt asset files to the default result directory - Add a delay between retries. The delay is expressed as a time value, e.g. 200, 1s, 2.5m, 1h. Default unit is milliseconds. - 新增重試之間的延遲。延遲以時間值表示,例如 200、1s、2.5m、1h。預設單位為毫秒。 + Add a delay between retries. The delay is expressed as a time value, e.g. 200, 500ms, 1s, 2.5m, 1h, 1d. Default unit is milliseconds. + 新增重試之間的延遲。延遲以時間值表示,例如 200、1s、2.5m、1h。預設單位為毫秒。 - Option '--retry-failed-tests-delay' requires a valid time span value that is non-negative and no greater than 2147483647ms (~24.20:31:23.647) (e.g. 200, 1s, 2.5m, 1h) - 選項 '--retry-failed-tests-delay' 需要有效的時間範圍值,且必須為非負值,並且不大於 2147483647ms (約 24.20:31:23.647)(例如 200、1s、2.5m、1h) + Option '--retry-failed-tests-delay' requires a valid time span value that is non-negative and no greater than 2147483647ms (~24.20:31:23.647) (e.g. 200, 500ms, 1s, 2.5m, 1h, 1d) + 選項 '--retry-failed-tests-delay' 需要有效的時間範圍值,且必須為非負值,並且不大於 2147483647ms (約 24.20:31:23.647)(例如 200、1s、2.5m、1h) diff --git a/src/Platform/Microsoft.Testing.Platform/CommandLine/PlatformCommandLineProvider.cs b/src/Platform/Microsoft.Testing.Platform/CommandLine/PlatformCommandLineProvider.cs index ddfaab74d2..facac58d0d 100644 --- a/src/Platform/Microsoft.Testing.Platform/CommandLine/PlatformCommandLineProvider.cs +++ b/src/Platform/Microsoft.Testing.Platform/CommandLine/PlatformCommandLineProvider.cs @@ -123,14 +123,16 @@ public Task ValidateOptionArgumentsAsync(CommandLineOption com return ValidationResult.InvalidTask(string.Format(CultureInfo.InvariantCulture, PlatformResources.PlatformCommandLineExitOnProcessExitSingleArgument, ExitOnProcessExitOptionKey)); } - if (commandOption.Name == TimeoutOptionKey) + // CancellationTokenSource.CancelAfter caps at Timer.MaxSupportedTimeout + // (uint.MaxValue - 1 ms, ~49.7 days). Reject values above that range here so the + // user gets a friendly CLI error instead of an ArgumentOutOfRangeException from + // CancelAfter when the value is consumed later. + if (commandOption.Name == TimeoutOptionKey + && (!TimeSpanParser.TryParseRequireSuffix(arguments[0], out TimeSpan timeout) + || timeout <= TimeSpan.Zero + || timeout.TotalMilliseconds > uint.MaxValue - 1)) { - string arg = arguments[0]; - int size = arg.Length; - if ((char.ToLowerInvariant(arg[size - 1]) != 'h' && char.ToLowerInvariant(arg[size - 1]) != 'm' && char.ToLowerInvariant(arg[size - 1]) != 's') || !float.TryParse(arg[..(size - 1)], NumberStyles.Float, CultureInfo.InvariantCulture, out float _)) - { - return ValidationResult.InvalidTask(PlatformResources.PlatformCommandLineTimeoutArgumentErrorMessage); - } + return ValidationResult.InvalidTask(PlatformResources.PlatformCommandLineTimeoutArgumentErrorMessage); } if (commandOption.Name == ConfigFileOptionKey) diff --git a/src/Platform/Microsoft.Testing.Platform/Helpers/TimeSpanParser.cs b/src/Platform/Microsoft.Testing.Platform/Helpers/TimeSpanParser.cs index b40de13d96..48c7ed85c3 100644 --- a/src/Platform/Microsoft.Testing.Platform/Helpers/TimeSpanParser.cs +++ b/src/Platform/Microsoft.Testing.Platform/Helpers/TimeSpanParser.cs @@ -5,21 +5,50 @@ namespace Microsoft.Testing.Platform.Helpers; +[Embedded] +internal enum TimeSpanDefaultUnit +{ + Milliseconds, + Seconds, + Minutes, + Hours, + Days, +} + [Embedded] internal static partial class TimeSpanParser { private static readonly Regex Pattern = GetRegex(); #if NET7_0_OR_GREATER - [GeneratedRegex(@"(?^\d+(?:\.\d+)?)\s*(?ms|mil|m|h|d|s?[a-z]*)$", RegexOptions.IgnoreCase)] + [GeneratedRegex(@"^(?\d+(?:\.\d+)?)\s*(?ms|mils?|milliseconds?|s|secs?|seconds?|m|mins?|minutes?|h|hours?|d|days?)?$", RegexOptions.IgnoreCase)] private static partial Regex GetRegex(); #else - private static Regex GetRegex() => new(@"(?^\d+(?:\.\d+)?)\s*(?ms|mil|m|h|d|s?[a-z]*)$", RegexOptions.IgnoreCase); + private static Regex GetRegex() => new(@"^(?\d+(?:\.\d+)?)\s*(?ms|mils?|milliseconds?|s|secs?|seconds?|m|mins?|minutes?|h|hours?|d|days?)?$", RegexOptions.IgnoreCase); #endif - public static TimeSpan Parse(string? time) => TryParse(time, out TimeSpan result) ? result : throw GetFormatException(time); + public static TimeSpan Parse(string? time) => Parse(time, TimeSpanDefaultUnit.Milliseconds); + + public static TimeSpan Parse(string? time, TimeSpanDefaultUnit defaultUnit) + => TryParse(time, defaultUnit, out TimeSpan result) ? result : throw GetFormatException(time, defaultUnit, requireSuffix: false); + + public static TimeSpan ParseRequireSuffix(string? time) + => TryParseRequireSuffix(time, out TimeSpan result) ? result : throw GetFormatException(time, defaultUnit: null, requireSuffix: true); public static bool TryParse(string? time, out TimeSpan result) + => TryParse(time, TimeSpanDefaultUnit.Milliseconds, out result); + + public static bool TryParse(string? time, TimeSpanDefaultUnit defaultUnit, out TimeSpan result) + => TryParseCore(time, defaultUnit, requireSuffix: false, out result); + + /// + /// Parses a time value. Inputs without an explicit unit suffix (e.g. a bare number like "200") + /// are rejected. Use this overload for options where the unit must be explicit. + /// + public static bool TryParseRequireSuffix(string? time, out TimeSpan result) + => TryParseCore(time, defaultUnit: TimeSpanDefaultUnit.Milliseconds, requireSuffix: true, out result); + + private static bool TryParseCore(string? time, TimeSpanDefaultUnit defaultUnit, bool requireSuffix, out TimeSpan result) { if (RoslynString.IsNullOrWhiteSpace(time)) { @@ -35,49 +64,103 @@ public static bool TryParse(string? time, out TimeSpan result) } string value = match.Groups["value"].Value; - if (!double.TryParse(value, out double number)) + if (!double.TryParse(value, NumberStyles.Float, CultureInfo.InvariantCulture, out double number)) { - throw GetFormatException(value); + result = TimeSpan.Zero; + return false; } string suffix = match.Groups["suffix"].Value; + + // No suffix: dispatch on the caller-provided default unit (or reject if a suffix is required). + if (suffix.Length == 0) + { + if (requireSuffix) + { + result = TimeSpan.Zero; + return false; + } + + return TryFromUnit(number, defaultUnit, out result); + } + StringComparison c = StringComparison.OrdinalIgnoreCase; - // mil to distinguish milliseconds from minutes - // "" when there is just the raw milliseconds value - if (suffix.StartsWith("ms", c) || suffix.StartsWith("mil", c) || suffix == string.Empty) + // "ms"/"mil"/"millisecond[s]" all map to milliseconds and are checked first to + // disambiguate from the "m" (minutes) prefix. + if (suffix.StartsWith("ms", c) || suffix.StartsWith("mil", c)) { - result = TimeSpan.FromMilliseconds(number); - return true; + return TryCreateTimeSpan(TimeSpan.FromMilliseconds, number, out result); } - if (suffix.StartsWith("s", StringComparison.Ordinal)) + if (suffix.StartsWith("s", c)) { - result = TimeSpan.FromSeconds(number); - return true; + return TryCreateTimeSpan(TimeSpan.FromSeconds, number, out result); } - if (suffix.StartsWith("m", StringComparison.Ordinal)) + if (suffix.StartsWith("m", c)) { - result = TimeSpan.FromMinutes(number); - return true; + return TryCreateTimeSpan(TimeSpan.FromMinutes, number, out result); } - if (suffix.StartsWith("h", StringComparison.Ordinal)) + if (suffix.StartsWith("h", c)) { - result = TimeSpan.FromHours(number); - return true; + return TryCreateTimeSpan(TimeSpan.FromHours, number, out result); } - if (suffix.StartsWith("d", StringComparison.Ordinal)) + if (suffix.StartsWith("d", c)) { - result = TimeSpan.FromDays(number); - return true; + return TryCreateTimeSpan(TimeSpan.FromDays, number, out result); } result = TimeSpan.Zero; return false; } - private static FormatException GetFormatException(string? value) => new($"The value '{value}' is not a valid time string. Use a time string in this format 5400000 / 5400000ms / 5400s / 90m"); + private static bool TryFromUnit(double number, TimeSpanDefaultUnit unit, out TimeSpan result) + => unit switch + { + TimeSpanDefaultUnit.Milliseconds => TryCreateTimeSpan(TimeSpan.FromMilliseconds, number, out result), + TimeSpanDefaultUnit.Seconds => TryCreateTimeSpan(TimeSpan.FromSeconds, number, out result), + TimeSpanDefaultUnit.Minutes => TryCreateTimeSpan(TimeSpan.FromMinutes, number, out result), + TimeSpanDefaultUnit.Hours => TryCreateTimeSpan(TimeSpan.FromHours, number, out result), + TimeSpanDefaultUnit.Days => TryCreateTimeSpan(TimeSpan.FromDays, number, out result), + _ => Fail(out result), + }; + + private static bool Fail(out TimeSpan result) + { + result = TimeSpan.Zero; + return false; + } + + private static bool TryCreateTimeSpan(Func factory, double number, out TimeSpan result) + { + try + { + result = factory(number); + return true; + } + catch (OverflowException) + { + result = TimeSpan.Zero; + return false; + } + catch (ArgumentException) + { + result = TimeSpan.Zero; + return false; + } + } + + private static FormatException GetFormatException(string? value, TimeSpanDefaultUnit? defaultUnit, bool requireSuffix) + => new($"The value '{value}' is not a valid time string. {GetGrammarHint(defaultUnit, requireSuffix)}"); + + private static string GetGrammarHint(TimeSpanDefaultUnit? defaultUnit, bool requireSuffix) + { + const string SuffixGrammar = "Use [ms|s|m|h|d] (long forms 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted), e.g. '500ms', '5400s', '90m', '1.5h', '1d'."; + return requireSuffix || defaultUnit is null + ? SuffixGrammar + " A unit suffix is required." + : SuffixGrammar + $" A bare number defaults to {defaultUnit.Value.ToString().ToLowerInvariant()}."; + } } diff --git a/src/Platform/Microsoft.Testing.Platform/Hosts/TestHostBuilder.CommonServices.cs b/src/Platform/Microsoft.Testing.Platform/Hosts/TestHostBuilder.CommonServices.cs index 35a796577d..b03668a8bf 100644 --- a/src/Platform/Microsoft.Testing.Platform/Hosts/TestHostBuilder.CommonServices.cs +++ b/src/Platform/Microsoft.Testing.Platform/Hosts/TestHostBuilder.CommonServices.cs @@ -197,21 +197,11 @@ private async Task SetupCommonServicesAsync( if (commandLineOptions.IsOptionSet(PlatformCommandLineProvider.TimeoutOptionKey) && commandLineOptions.TryGetOptionArgumentList(PlatformCommandLineProvider.TimeoutOptionKey, out string[]? args)) { - string arg = args[0]; - int size = arg.Length; - if (!float.TryParse(arg[..(size - 1)], NumberStyles.Float, CultureInfo.InvariantCulture, out float value)) + if (!TimeSpanParser.TryParseRequireSuffix(args[0], out TimeSpan timeout)) { throw ApplicationStateGuard.Unreachable(); } - TimeSpan timeout = char.ToLowerInvariant(arg[size - 1]) switch - { - 'h' => TimeSpan.FromHours(value), - 'm' => TimeSpan.FromMinutes(value), - 's' => TimeSpan.FromSeconds(value), - _ => throw ApplicationStateGuard.Unreachable(), - }; - context.TestApplicationCancellationTokenSource.CancelAfter(timeout); } diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/PlatformResources.resx b/src/Platform/Microsoft.Testing.Platform/Resources/PlatformResources.resx index 475c56ea18..f51a93486b 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/PlatformResources.resx +++ b/src/Platform/Microsoft.Testing.Platform/Resources/PlatformResources.resx @@ -623,11 +623,11 @@ Valid values are 'All', 'Failed', 'None'. Default is 'All'. --show-stdout and --show-stderr expect a single parameter with value 'All', 'Failed', or 'None'. - 'timeout' option should have one argument as string in the format <value>[h|m|s] where 'value' is float + 'timeout' option should have one argument as a time value with an explicit unit suffix, e.g. '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) A global test execution timeout. -Takes one argument as string in the format <value>[h|m|s] where 'value' is float. +Takes one argument as a time value with an explicit unit suffix. Accepted units are 'ms', 's', 'm', 'h', 'd' (long forms 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted), e.g. '500ms', '5400s', '90m', '1.5h', '1d'. The ILoggerFactory has not been built yet. diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.cs.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.cs.xlf index dc67ce0c91..5b0b4350cf 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.cs.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.cs.xlf @@ -654,14 +654,14 @@ Výchozí hodnota je TestResults v adresáři, který obsahuje testovací aplika - 'timeout' option should have one argument as string in the format <value>[h|m|s] where 'value' is float - Možnost timeout by měla mít jeden argument jako řetězec ve formátu <value>[h|m|s], kde value je hodnota datového typu float. + 'timeout' option should have one argument as a time value with an explicit unit suffix, e.g. '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) + Možnost timeout by měla mít jeden argument jako řetězec ve formátu <value>[h|m|s], kde value je hodnota datového typu float. A global test execution timeout. -Takes one argument as string in the format <value>[h|m|s] where 'value' is float. - Vypršel globální časový limit provádění testu. +Takes one argument as a time value with an explicit unit suffix. Accepted units are 'ms', 's', 'm', 'h', 'd' (long forms 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted), e.g. '500ms', '5400s', '90m', '1.5h', '1d'. + Vypršel globální časový limit provádění testu. Může mít jenom jeden argument jako řetězec ve formátu <value>[h|m|s], kde value je hodnota datového typu float. diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.de.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.de.xlf index ba194e66e2..ab86b109c8 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.de.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.de.xlf @@ -654,14 +654,14 @@ Der Standardwert ist "TestResults" im Verzeichnis, das die Testanwendung enthäl - 'timeout' option should have one argument as string in the format <value>[h|m|s] where 'value' is float - Die Option "timeout" muss ein Argument als Zeichenfolge im Format <value>[h|m|s] aufweisen, wobei "value" auf "float" festgelegt ist. + 'timeout' option should have one argument as a time value with an explicit unit suffix, e.g. '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) + Die Option "timeout" muss ein Argument als Zeichenfolge im Format <value>[h|m|s] aufweisen, wobei "value" auf "float" festgelegt ist. A global test execution timeout. -Takes one argument as string in the format <value>[h|m|s] where 'value' is float. - Eine globale Testausführungszeit. +Takes one argument as a time value with an explicit unit suffix. Accepted units are 'ms', 's', 'm', 'h', 'd' (long forms 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted), e.g. '500ms', '5400s', '90m', '1.5h', '1d'. + Eine globale Testausführungszeit. Nimmt ein Argument als Zeichenfolge im Format <value>[h|m|s], wobei "value" auf "float" festgelegt ist. diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.es.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.es.xlf index bd4c3c9214..325e1620ef 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.es.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.es.xlf @@ -654,14 +654,14 @@ El valor predeterminado es TestResults en el directorio que contiene la aplicaci - 'timeout' option should have one argument as string in the format <value>[h|m|s] where 'value' is float - La opción 'timeout' debe tener un argumento como cadena con el formato <value>[h|m|s] donde 'value' es float + 'timeout' option should have one argument as a time value with an explicit unit suffix, e.g. '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) + La opción 'timeout' debe tener un argumento como cadena con el formato <value>[h|m|s] donde 'value' es float A global test execution timeout. -Takes one argument as string in the format <value>[h|m|s] where 'value' is float. - Tiempo de espera de ejecución de prueba global. +Takes one argument as a time value with an explicit unit suffix. Accepted units are 'ms', 's', 'm', 'h', 'd' (long forms 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted), e.g. '500ms', '5400s', '90m', '1.5h', '1d'. + Tiempo de espera de ejecución de prueba global. Toma un argumento como cadena con el formato <value>[h|m|s] donde 'value' es float. diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.fr.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.fr.xlf index b43db09ffa..34f17c675e 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.fr.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.fr.xlf @@ -654,14 +654,14 @@ La valeur par défaut est TestResults dans le répertoire qui contient l’appli - 'timeout' option should have one argument as string in the format <value>[h|m|s] where 'value' is float - L’option « timeout » doit avoir un argument sous forme de chaîne au format <value>[h|m|s] où « value » est float + 'timeout' option should have one argument as a time value with an explicit unit suffix, e.g. '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) + L’option « timeout » doit avoir un argument sous forme de chaîne au format <value>[h|m|s] où « value » est float A global test execution timeout. -Takes one argument as string in the format <value>[h|m|s] where 'value' is float. - Délai global d’exécution du test. +Takes one argument as a time value with an explicit unit suffix. Accepted units are 'ms', 's', 'm', 'h', 'd' (long forms 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted), e.g. '500ms', '5400s', '90m', '1.5h', '1d'. + Délai global d’exécution du test. Prend un argument sous forme de chaîne au format <value>[h|m|s] où « value » est float. diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.it.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.it.xlf index bdfe056496..d834bc51a9 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.it.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.it.xlf @@ -654,14 +654,14 @@ L’impostazione predefinita è TestResults nella directory che contiene l'appli - 'timeout' option should have one argument as string in the format <value>[h|m|s] where 'value' is float - L'opzione 'timeout' deve contenere un argomento come stringa nel formato <value>[h|m|s] dove 'value' è float + 'timeout' option should have one argument as a time value with an explicit unit suffix, e.g. '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) + L'opzione 'timeout' deve contenere un argomento come stringa nel formato <value>[h|m|s] dove 'value' è float A global test execution timeout. -Takes one argument as string in the format <value>[h|m|s] where 'value' is float. - Un timeout di esecuzione test globale. +Takes one argument as a time value with an explicit unit suffix. Accepted units are 'ms', 's', 'm', 'h', 'd' (long forms 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted), e.g. '500ms', '5400s', '90m', '1.5h', '1d'. + Un timeout di esecuzione test globale. Acquisisce un argomento come stringa nel formato <value>[h|m|s] dove 'value' è float. diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ja.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ja.xlf index 97edfe7878..265a56956d 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ja.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ja.xlf @@ -655,14 +655,14 @@ The default is TestResults in the directory that contains the test application.< - 'timeout' option should have one argument as string in the format <value>[h|m|s] where 'value' is float - 'timeout' オプションには、1 つの引数を文字列として <value>[h|m|s] の形式で指定する必要があります。この場合、'value' は float です + 'timeout' option should have one argument as a time value with an explicit unit suffix, e.g. '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) + 'timeout' オプションには、1 つの引数を文字列として <value>[h|m|s] の形式で指定する必要があります。この場合、'value' は float です A global test execution timeout. -Takes one argument as string in the format <value>[h|m|s] where 'value' is float. - グローバル テスト実行のタイムアウト。 +Takes one argument as a time value with an explicit unit suffix. Accepted units are 'ms', 's', 'm', 'h', 'd' (long forms 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted), e.g. '500ms', '5400s', '90m', '1.5h', '1d'. + グローバル テスト実行のタイムアウト。 1 つの引数を文字列として <value>[h|m|s] の形式で使用します。この場合、'value' は float です。 diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ko.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ko.xlf index 3d791db029..43a7933678 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ko.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ko.xlf @@ -654,14 +654,14 @@ The default is TestResults in the directory that contains the test application.< - 'timeout' option should have one argument as string in the format <value>[h|m|s] where 'value' is float - 'timeout' 옵션에는 'value'가 float인 <value>[h|m|s] 형식의 문자열로 인수가 하나 있어야 합니다. + 'timeout' option should have one argument as a time value with an explicit unit suffix, e.g. '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) + 'timeout' 옵션에는 'value'가 float인 <value>[h|m|s] 형식의 문자열로 인수가 하나 있어야 합니다. A global test execution timeout. -Takes one argument as string in the format <value>[h|m|s] where 'value' is float. - 전역 테스트 실행 시간 제한입니다. +Takes one argument as a time value with an explicit unit suffix. Accepted units are 'ms', 's', 'm', 'h', 'd' (long forms 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted), e.g. '500ms', '5400s', '90m', '1.5h', '1d'. + 전역 테스트 실행 시간 제한입니다. 'value'가 float인 <value>[h|m|s] 형식의 문자열로 인수 하나를 사용합니다. diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.pl.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.pl.xlf index 70985a304e..bb1c6d4cb4 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.pl.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.pl.xlf @@ -654,14 +654,14 @@ Wartość domyślna to TestResults w katalogu zawierającym aplikację testową. - 'timeout' option should have one argument as string in the format <value>[h|m|s] where 'value' is float - Opcja „timeout” powinna mieć jeden argument jako ciąg w formacie <value>[h|m|s], gdzie element „value” ma wartość zmiennoprzecinkową + 'timeout' option should have one argument as a time value with an explicit unit suffix, e.g. '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) + Opcja „timeout” powinna mieć jeden argument jako ciąg w formacie <value>[h|m|s], gdzie element „value” ma wartość zmiennoprzecinkową A global test execution timeout. -Takes one argument as string in the format <value>[h|m|s] where 'value' is float. - Limit czasu wykonywania testu globalnego. +Takes one argument as a time value with an explicit unit suffix. Accepted units are 'ms', 's', 'm', 'h', 'd' (long forms 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted), e.g. '500ms', '5400s', '90m', '1.5h', '1d'. + Limit czasu wykonywania testu globalnego. Pobiera jeden argument jako ciąg w formacie <value>[h|m|s], gdzie element „value” ma wartość zmiennoprzecinkową. diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.pt-BR.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.pt-BR.xlf index aa46d0ef8d..60affedd2f 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.pt-BR.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.pt-BR.xlf @@ -654,14 +654,14 @@ O padrão é TestResults no diretório que contém o aplicativo de teste. - 'timeout' option should have one argument as string in the format <value>[h|m|s] where 'value' is float - A opção 'timeout' deve ter um argumento como cadeia de caracteres no formato <value>[h|m|s] onde 'value' é float + 'timeout' option should have one argument as a time value with an explicit unit suffix, e.g. '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) + A opção 'timeout' deve ter um argumento como cadeia de caracteres no formato <value>[h|m|s] onde 'value' é float A global test execution timeout. -Takes one argument as string in the format <value>[h|m|s] where 'value' is float. - Um tempo limite global para a execução do teste. +Takes one argument as a time value with an explicit unit suffix. Accepted units are 'ms', 's', 'm', 'h', 'd' (long forms 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted), e.g. '500ms', '5400s', '90m', '1.5h', '1d'. + Um tempo limite global para a execução do teste. Recebe um argumento como cadeia de caracteres no formato <valor>[h|m|s] em que 'valor' é float. diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ru.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ru.xlf index 4f5c785313..55225172aa 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ru.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ru.xlf @@ -654,14 +654,14 @@ The default is TestResults in the directory that contains the test application.< - 'timeout' option should have one argument as string in the format <value>[h|m|s] where 'value' is float - Параметр "timeout" должен иметь один аргумент в виде строки в формате <value>[h|m|s], где "value" — число с плавающей точкой + 'timeout' option should have one argument as a time value with an explicit unit suffix, e.g. '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) + Параметр "timeout" должен иметь один аргумент в виде строки в формате <value>[h|m|s], где "value" — число с плавающей точкой A global test execution timeout. -Takes one argument as string in the format <value>[h|m|s] where 'value' is float. - Глобальное время ожидания выполнения теста. +Takes one argument as a time value with an explicit unit suffix. Accepted units are 'ms', 's', 'm', 'h', 'd' (long forms 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted), e.g. '500ms', '5400s', '90m', '1.5h', '1d'. + Глобальное время ожидания выполнения теста. Принимает один аргумент в виде строки в формате <value>[h|m|s], где "value" — число с плавающей точкой. diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.tr.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.tr.xlf index 906259438c..eec63d4d39 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.tr.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.tr.xlf @@ -654,14 +654,14 @@ Varsayılan değer, test uygulamasını içeren dizindeki TestResults'dır. - 'timeout' option should have one argument as string in the format <value>[h|m|s] where 'value' is float - 'timeout' seçeneği, 'value' değerinin kayan olduğu <value>[h|m|s] biçiminde dize olarak bir bağımsız değişkene sahip olmalıdır + 'timeout' option should have one argument as a time value with an explicit unit suffix, e.g. '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) + 'timeout' seçeneği, 'value' değerinin kayan olduğu <value>[h|m|s] biçiminde dize olarak bir bağımsız değişkene sahip olmalıdır A global test execution timeout. -Takes one argument as string in the format <value>[h|m|s] where 'value' is float. - Genel bir test yürütme zaman aşımı. +Takes one argument as a time value with an explicit unit suffix. Accepted units are 'ms', 's', 'm', 'h', 'd' (long forms 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted), e.g. '500ms', '5400s', '90m', '1.5h', '1d'. + Genel bir test yürütme zaman aşımı. Bir bağımsız değişkeni, 'value' değerinin kayan olduğu <value>[h|m|s] biçiminde dize olarak alır. diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.zh-Hans.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.zh-Hans.xlf index 41afc5ebc9..ced0f2c455 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.zh-Hans.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.zh-Hans.xlf @@ -654,14 +654,14 @@ The default is TestResults in the directory that contains the test application.< - 'timeout' option should have one argument as string in the format <value>[h|m|s] where 'value' is float - "timeout" 选项应有一个字符串形式的参数,格式为 <value>[h|m|s],其中 "value" 为浮点型 + 'timeout' option should have one argument as a time value with an explicit unit suffix, e.g. '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) + "timeout" 选项应有一个字符串形式的参数,格式为 <value>[h|m|s],其中 "value" 为浮点型 A global test execution timeout. -Takes one argument as string in the format <value>[h|m|s] where 'value' is float. - 全局测试执行超时。 +Takes one argument as a time value with an explicit unit suffix. Accepted units are 'ms', 's', 'm', 'h', 'd' (long forms 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted), e.g. '500ms', '5400s', '90m', '1.5h', '1d'. + 全局测试执行超时。 获取一个字符串形式的参数,格式为 <value>[h|m|s],其中 "value" 为浮点型。 diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.zh-Hant.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.zh-Hant.xlf index b179a83eab..b180f19925 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.zh-Hant.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.zh-Hant.xlf @@ -654,14 +654,14 @@ The default is TestResults in the directory that contains the test application.< - 'timeout' option should have one argument as string in the format <value>[h|m|s] where 'value' is float - 'timeout' 選項應該有一個引數作為字串,格式為 <value>[h|m|s],其中 'value' 為 float + 'timeout' option should have one argument as a time value with an explicit unit suffix, e.g. '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) + 'timeout' 選項應該有一個引數作為字串,格式為 <value>[h|m|s],其中 'value' 為 float A global test execution timeout. -Takes one argument as string in the format <value>[h|m|s] where 'value' is float. - 全域測試執行逾時。 +Takes one argument as a time value with an explicit unit suffix. Accepted units are 'ms', 's', 'm', 'h', 'd' (long forms 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted), e.g. '500ms', '5400s', '90m', '1.5h', '1d'. + 全域測試執行逾時。 將一個引數作為字串,格式為 <value>[h|m|s],其中 'value' 為 float。 diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/HelpInfoTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/HelpInfoTests.cs index ff334acdfc..2816bde59c 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/HelpInfoTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/HelpInfoTests.cs @@ -67,7 +67,7 @@ The directory where the test results are going to be placed. The default is TestResults in the directory that contains the test application. --timeout A global test execution timeout. - Takes one argument as string in the format [h|m|s] where 'value' is float. + Takes one argument as a time value with an explicit unit suffix. Accepted units are 'ms', 's', 'm', 'h', 'd' (long forms 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted), e.g. '500ms', '5400s', '90m', '1.5h', '1d'. Extension options: --filter Filters tests using the given expression. For more information, see the Filter option details section. For more information and examples on how to use selective unit test filtering, see https://learn.microsoft.com/dotnet/core/testing/selective-unit-tests. diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoAllExtensionsTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoAllExtensionsTests.cs index 0d4529f6b7..da0fdbb490 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoAllExtensionsTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoAllExtensionsTests.cs @@ -62,14 +62,14 @@ The directory where the test results are going to be placed. --retry-failed-tests Retry failed tests the given number of times --retry-failed-tests-delay - Add a delay between retries. The delay is expressed as a time value, e.g. 200, 1s, 2.5m, 1h. Default unit is milliseconds. + Add a delay between retries. The delay is expressed as a time value, e.g. 200, 500ms, 1s, 2.5m, 1h, 1d. Default unit is milliseconds. --retry-failed-tests-max-percentage Disable retry mechanism if the percentage of failed tests is greater than the specified value --retry-failed-tests-max-tests Disable retry mechanism if the number of failed tests is greater than the specified value --timeout A global test execution timeout. - Takes one argument as string in the format [h|m|s] where 'value' is float. + Takes one argument as a time value with an explicit unit suffix. Accepted units are 'ms', 's', 'm', 'h', 'd' (long forms 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted), e.g. '500ms', '5400s', '90m', '1.5h', '1d'. Extension options: --crash-report [Linux/macOS only] Generate a JSON crash report when the test process crashes. Combine with '--crashdump' to also generate a dump file. Requires .NET 7+ when used alone; .NET 6+ when combined with '--crashdump'. This runtime requirement is not enforced by the tool: on unsupported runtimes no crash report will be emitted. Not supported on Windows due to a .NET runtime limitation (dotnet/runtime#80191). @@ -88,9 +88,12 @@ Specify the name of the dump file --hangdump-timeout Specify the timeout after which the dump will be generated. The timeout value is specified in one of the following formats: - 1.5h, 1.5hour, 1.5hours, + 500ms, 500mil, 500millisecond, 500milliseconds, + 5400s, 5400sec, 5400second, 5400seconds, 90m, 90min, 90minute, 90minutes, - 5400s, 5400sec, 5400second, 5400seconds. + 1.5h, 1.5hour, 1.5hours, + 1d, 1day, 1days. + A bare number (with no suffix) is interpreted as milliseconds. Default is 30m. --hangdump-type Specify the type of the dump. @@ -293,7 +296,7 @@ Note that this is slowing down the test execution. Arity: 1 Hidden: False Description: A global test execution timeout. - Takes one argument as string in the format [h|m|s] where 'value' is float. + Takes one argument as a time value with an explicit unit suffix. Accepted units are 'ms', 's', 'm', 'h', 'd' (long forms 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted), e.g. '500ms', '5400s', '90m', '1.5h', '1d'. Registered command line providers: AzureDevOpsCommandLineProvider Name: Azure DevOps report generator @@ -385,9 +388,12 @@ Takes one argument as string in the format [h|m|s] where 'value' is float Hidden: False Description: Specify the timeout after which the dump will be generated. The timeout value is specified in one of the following formats: - 1.5h, 1.5hour, 1.5hours, + 500ms, 500mil, 500millisecond, 500milliseconds, + 5400s, 5400sec, 5400second, 5400seconds, 90m, 90min, 90minute, 90minutes, - 5400s, 5400sec, 5400second, 5400seconds. + 1.5h, 1.5hour, 1.5hours, + 1d, 1day, 1days. + A bare number (with no suffix) is interpreted as milliseconds. Default is 30m. --hangdump-type Arity: 1 @@ -433,7 +439,7 @@ Default type is 'Full' --retry-failed-tests-delay Arity: 1 Hidden: False - Description: Add a delay between retries. The delay is expressed as a time value, e.g. 200, 1s, 2.5m, 1h. Default unit is milliseconds. + Description: Add a delay between retries. The delay is expressed as a time value, e.g. 200, 500ms, 1s, 2.5m, 1h, 1d. Default unit is milliseconds. --retry-failed-tests-max-percentage Arity: 1 Hidden: False diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoTests.cs index cb4db4d5d2..73abafda02 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoTests.cs @@ -61,7 +61,7 @@ The directory where the test results are going to be placed. The default is TestResults in the directory that contains the test application. --timeout A global test execution timeout. - Takes one argument as string in the format [h|m|s] where 'value' is float. + Takes one argument as a time value with an explicit unit suffix. Accepted units are 'ms', 's', 'm', 'h', 'd' (long forms 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted), e.g. '500ms', '5400s', '90m', '1.5h', '1d'. Extension options: --no-ansi Disable outputting ANSI escape characters to screen. @@ -251,7 +251,7 @@ Note that this is slowing down the test execution\. Arity: 1 Hidden: False Description: A global test execution timeout. - Takes one argument as string in the format \[h\|m\|s\] where 'value' is float\. + Takes one argument as a time value with an explicit unit suffix\. Accepted units are 'ms', 's', 'm', 'h', 'd' \(long forms 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted\), e\.g\. '500ms', '5400s', '90m', '1\.5h', '1d'\. Registered command line providers: TerminalTestReporterCommandLineOptionsProvider Name: Terminal test reporter diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TimeoutTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TimeoutTests.cs index 5bc3d61ad0..3d8547d396 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TimeoutTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TimeoutTests.cs @@ -14,7 +14,7 @@ public async Task TimeoutWithInvalidArg_WithoutLetterSuffix_OutputInvalidMessage TestHostResult testHostResult = await testHost.ExecuteAsync("--timeout 5", cancellationToken: TestContext.CancellationToken); testHostResult.AssertExitCodeIs(ExitCode.InvalidCommandLine); - testHostResult.AssertOutputContains("'timeout' option should have one argument as string in the format [h|m|s] where 'value' is float"); + testHostResult.AssertOutputContains("'timeout' option should have one argument as a time value with an explicit unit suffix"); } [DynamicData(nameof(TargetFrameworks.AllForDynamicData), typeof(TargetFrameworks))] @@ -25,7 +25,7 @@ public async Task TimeoutWithInvalidArg_WithInvalidLetterSuffix_OutputInvalidMes TestHostResult testHostResult = await testHost.ExecuteAsync("--timeout 5y", cancellationToken: TestContext.CancellationToken); testHostResult.AssertExitCodeIs(ExitCode.InvalidCommandLine); - testHostResult.AssertOutputContains("'timeout' option should have one argument as string in the format [h|m|s] where 'value' is float"); + testHostResult.AssertOutputContains("'timeout' option should have one argument as a time value with an explicit unit suffix"); } [DynamicData(nameof(TargetFrameworks.AllForDynamicData), typeof(TargetFrameworks))] @@ -36,7 +36,31 @@ public async Task TimeoutWithInvalidArg_WithInvalidFormat_OutputInvalidMessage(s TestHostResult testHostResult = await testHost.ExecuteAsync("--timeout 5h6m", cancellationToken: TestContext.CancellationToken); testHostResult.AssertExitCodeIs(ExitCode.InvalidCommandLine); - testHostResult.AssertOutputContains("'timeout' option should have one argument as string in the format [h|m|s] where 'value' is float"); + testHostResult.AssertOutputContains("'timeout' option should have one argument as a time value with an explicit unit suffix"); + } + + [DynamicData(nameof(TargetFrameworks.AllForDynamicData), typeof(TargetFrameworks))] + [TestMethod] + public async Task TimeoutWithInvalidArg_WithBogusUnitTail_OutputInvalidMessage(string tfm) + { + // The previous parser silently accepted unrecognized alphabetic tails like '90monkey' as 90 minutes. + var testHost = TestInfrastructure.TestHost.LocateFrom(AssetFixture.NoExtensionTargetAssetPath, TestAssetFixture.AssetName, tfm); + TestHostResult testHostResult = await testHost.ExecuteAsync("--timeout 90monkey", cancellationToken: TestContext.CancellationToken); + + testHostResult.AssertExitCodeIs(ExitCode.InvalidCommandLine); + testHostResult.AssertOutputContains("'timeout' option should have one argument as a time value with an explicit unit suffix"); + } + + [DynamicData(nameof(TargetFrameworks.AllForDynamicData), typeof(TargetFrameworks))] + [TestMethod] + public async Task TimeoutWithInvalidArg_ExceedingCancelAfterRange_OutputInvalidMessage(string tfm) + { + // 60 days is well past CancellationTokenSource.CancelAfter's ~49.7-day cap. + var testHost = TestInfrastructure.TestHost.LocateFrom(AssetFixture.NoExtensionTargetAssetPath, TestAssetFixture.AssetName, tfm); + TestHostResult testHostResult = await testHost.ExecuteAsync("--timeout 60d", cancellationToken: TestContext.CancellationToken); + + testHostResult.AssertExitCodeIs(ExitCode.InvalidCommandLine); + testHostResult.AssertOutputContains("'timeout' option should have one argument as a time value with an explicit unit suffix"); } [DynamicData(nameof(TargetFrameworks.AllForDynamicData), typeof(TargetFrameworks))] @@ -50,6 +74,30 @@ public async Task TimeoutWithValidArg_WithTestTimeOut_OutputContainsCancelingMes testHostResult.AssertOutputContains("Canceling the test session"); } + [DynamicData(nameof(TargetFrameworks.AllForDynamicData), typeof(TargetFrameworks))] + [TestMethod] + public async Task TimeoutWithValidArg_WithMillisecondsSuffix_WithTestTimeOut_OutputContainsCancelingMessage(string tfm) + { + // 'ms' is a newly supported suffix for --timeout (previously rejected). + var testHost = TestInfrastructure.TestHost.LocateFrom(AssetFixture.NoExtensionTargetAssetPath, TestAssetFixture.AssetName, tfm); + TestHostResult testHostResult = await testHost.ExecuteAsync("--timeout 500ms", cancellationToken: TestContext.CancellationToken); + + testHostResult.AssertExitCodeIsNot(ExitCode.Success); + testHostResult.AssertOutputContains("Canceling the test session"); + } + + [DynamicData(nameof(TargetFrameworks.AllForDynamicData), typeof(TargetFrameworks))] + [TestMethod] + public async Task TimeoutWithValidArg_WithLongFormSuffix_WithTestTimeOut_OutputContainsCancelingMessage(string tfm) + { + // Long-form suffixes like 'seconds' are newly supported for --timeout. + var testHost = TestInfrastructure.TestHost.LocateFrom(AssetFixture.NoExtensionTargetAssetPath, TestAssetFixture.AssetName, tfm); + TestHostResult testHostResult = await testHost.ExecuteAsync("--timeout 1seconds", cancellationToken: TestContext.CancellationToken); + + testHostResult.AssertExitCodeIsNot(ExitCode.Success); + testHostResult.AssertOutputContains("Canceling the test session"); + } + [DynamicData(nameof(TargetFrameworks.AllForDynamicData), typeof(TargetFrameworks))] [TestMethod] public async Task TimeoutWithValidArg_WithSecondAsSuffix_WithTestNotTimeOut_OutputDoesNotContainCancelingMessage(string tfm) diff --git a/test/UnitTests/Microsoft.Testing.Platform.UnitTests/Helpers/TimeSpanParserTests.cs b/test/UnitTests/Microsoft.Testing.Platform.UnitTests/Helpers/TimeSpanParserTests.cs index a681b6326d..9236bd529d 100644 --- a/test/UnitTests/Microsoft.Testing.Platform.UnitTests/Helpers/TimeSpanParserTests.cs +++ b/test/UnitTests/Microsoft.Testing.Platform.UnitTests/Helpers/TimeSpanParserTests.cs @@ -32,6 +32,11 @@ public void Parse_NullOrWhitespace_ThrowsFormatException(string? input) [DataRow("abc")] [DataRow("ms")] [DataRow("-1s")] + [DataRow("1monkey")] // not a recognized unit suffix + [DataRow("1hotdog")] // not a recognized unit suffix + [DataRow("1xyz")] + [DataRow("1e3s")] // scientific notation not supported + [DataRow("+1s")] // explicit positive sign not supported public void TryParse_InvalidInput_ReturnsFalse(string input) { bool result = TimeSpanParser.TryParse(input, out TimeSpan value); @@ -44,6 +49,8 @@ public void TryParse_InvalidInput_ReturnsFalse(string input) [DataRow("invalid")] [DataRow("abc")] [DataRow("-1s")] + [DataRow("1monkey")] + [DataRow("1xyz")] public void Parse_InvalidInput_ThrowsFormatException(string input) => Assert.ThrowsExactly(() => TimeSpanParser.Parse(input)); @@ -171,6 +178,147 @@ public void Parse_ValidInput_ReturnsCorrectTimeSpan() Assert.AreEqual(TimeSpan.FromSeconds(5400), result); } + [TestMethod] + [DataRow("1S")] // uppercase single-char suffix + [DataRow("1M")] + [DataRow("1H")] + [DataRow("1D")] + [DataRow("1Hour")] // mixed case long form + [DataRow("1MINUTES")] // upper case long form + public void TryParse_UppercaseSuffix_ParsesCorrectly(string input) + { + bool result = TimeSpanParser.TryParse(input, out TimeSpan value); + + Assert.IsTrue(result); + Assert.AreNotEqual(TimeSpan.Zero, value); + } + + [TestMethod] + public void TryParse_OverflowValue_ReturnsFalseInsteadOfThrowing() + { + // 10^18 days is far beyond TimeSpan.MaxValue. + bool result = TimeSpanParser.TryParse("1000000000000000000d", out TimeSpan value); + + Assert.IsFalse(result); + Assert.AreEqual(TimeSpan.Zero, value); + } + + [TestMethod] + [DataRow("90")] + [DataRow("90 ")] + [DataRow("")] + public void TryParseRequireSuffix_BareNumberFails(string input) + { + bool result = TimeSpanParser.TryParseRequireSuffix(input, out TimeSpan _); + + Assert.IsFalse(result); + } + + [TestMethod] + public void TryParseRequireSuffix_BareZeroFails() + => Assert.IsFalse(TimeSpanParser.TryParseRequireSuffix("0", out TimeSpan _)); + + [TestMethod] + public void TryParse_WithDefaultUnitMilliseconds_BareNumberUsesMilliseconds() + { + Assert.IsTrue(TimeSpanParser.TryParse("250", TimeSpanDefaultUnit.Milliseconds, out TimeSpan value)); + Assert.AreEqual(TimeSpan.FromMilliseconds(250), value); + } + + [TestMethod] + public void TryParse_WithDefaultUnitSeconds_BareNumberUsesSeconds() + { + Assert.IsTrue(TimeSpanParser.TryParse("30", TimeSpanDefaultUnit.Seconds, out TimeSpan value)); + Assert.AreEqual(TimeSpan.FromSeconds(30), value); + } + + [TestMethod] + public void TryParse_WithDefaultUnitMinutes_BareNumberUsesMinutes() + { + Assert.IsTrue(TimeSpanParser.TryParse("5", TimeSpanDefaultUnit.Minutes, out TimeSpan value)); + Assert.AreEqual(TimeSpan.FromMinutes(5), value); + } + + [TestMethod] + public void TryParse_WithDefaultUnitHours_BareNumberUsesHours() + { + Assert.IsTrue(TimeSpanParser.TryParse("2", TimeSpanDefaultUnit.Hours, out TimeSpan value)); + Assert.AreEqual(TimeSpan.FromHours(2), value); + } + + [TestMethod] + public void TryParse_WithDefaultUnitDays_BareNumberUsesDays() + { + Assert.IsTrue(TimeSpanParser.TryParse("1", TimeSpanDefaultUnit.Days, out TimeSpan value)); + Assert.AreEqual(TimeSpan.FromDays(1), value); + } + + [TestMethod] + public void TryParse_WithDefaultUnit_ExplicitSuffixOverridesDefault_Smoke() + { + // Default is hours, but the explicit suffix is seconds. + Assert.IsTrue(TimeSpanParser.TryParse("30s", TimeSpanDefaultUnit.Hours, out TimeSpan value)); + Assert.AreEqual(TimeSpan.FromSeconds(30), value); + } + + [TestMethod] + public void TryParseRequireSuffix_ExplicitSuffixSucceeds() + { + Assert.IsTrue(TimeSpanParser.TryParseRequireSuffix("90m", out TimeSpan value)); + Assert.AreEqual(TimeSpan.FromMinutes(90), value); + } + + [TestMethod] + public void TryParse_ExplicitSuffix_AlwaysOverridesDefaultUnit() + { + var cases = new (string Input, TimeSpan Expected)[] + { + ("90ms", TimeSpan.FromMilliseconds(90)), + ("30s", TimeSpan.FromSeconds(30)), + ("2m", TimeSpan.FromMinutes(2)), + ("1h", TimeSpan.FromHours(1)), + ("1d", TimeSpan.FromDays(1)), + }; + + foreach ((string input, TimeSpan expected) in cases) + { + // The explicit suffix in the input must always take precedence over the supplied default. + foreach (TimeSpanDefaultUnit unit in (TimeSpanDefaultUnit[])Enum.GetValues(typeof(TimeSpanDefaultUnit))) + { + Assert.IsTrue(TimeSpanParser.TryParse(input, unit, out TimeSpan value), $"Should parse '{input}' with default {unit}"); + Assert.AreEqual(expected, value, $"Mismatch for '{input}' with default {unit}"); + } + } + } + + [TestMethod] + [DataRow(" 1s")] // leading whitespace not allowed + [DataRow("1s ")] // trailing whitespace not allowed + public void TryParse_OuterWhitespace_Fails(string input) + => Assert.IsFalse(TimeSpanParser.TryParse(input, out TimeSpan _)); + + [TestMethod] + public void TryParse_InnerWhitespaceBetweenValueAndSuffix_Succeeds() + { + // The regex permits optional whitespace between number and suffix. + Assert.IsTrue(TimeSpanParser.TryParse("1 s", out TimeSpan value)); + Assert.AreEqual(TimeSpan.FromSeconds(1), value); + } + + [TestMethod] + public void ParseRequireSuffix_BareNumberThrows() + { + FormatException ex = Assert.ThrowsExactly(() => TimeSpanParser.ParseRequireSuffix("90")); + Assert.Contains("A unit suffix is required", ex.Message); + } + + [TestMethod] + public void Parse_WithDefaultUnit_BareNumberMessageMentionsDefault() + { + FormatException ex = Assert.ThrowsExactly(() => TimeSpanParser.Parse("not-a-duration", TimeSpanDefaultUnit.Seconds)); + Assert.Contains("defaults to seconds", ex.Message); + } + [TestMethod] public void TryParse_And_Parse_AreConsistent() { From 3b9a8c62b950535127732a6627ebdb7c1a786878 Mon Sep 17 00:00:00 2001 From: Amaury Leveugle <11340282+Evangelink@users.noreply.github.com> Date: Sat, 23 May 2026 17:15:28 +0200 Subject: [PATCH 2/6] Address review feedback on duration parsing - Tighten TimeSpanParser regex so trailing whitespace is only accepted when a unit suffix follows (e.g. "90 " no longer matches). - Expand PlatformCommandLineTimeoutArgumentErrorMessage to mention the positive value and supported range (~49.7 days), not just the suffix grammar. Regenerated XLFs. - Update MSTest acceptance TimeoutTests to expect the new message. - Update TryParse_UppercaseSuffix_ParsesCorrectly to assert the exact TimeSpan for each input instead of just non-zero. Addresses review feedback on PR #8506. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Helpers/TimeSpanParser.cs | 4 +-- .../Resources/PlatformResources.resx | 2 +- .../Resources/xlf/PlatformResources.cs.xlf | 2 +- .../Resources/xlf/PlatformResources.de.xlf | 2 +- .../Resources/xlf/PlatformResources.es.xlf | 2 +- .../Resources/xlf/PlatformResources.fr.xlf | 2 +- .../Resources/xlf/PlatformResources.it.xlf | 2 +- .../Resources/xlf/PlatformResources.ja.xlf | 2 +- .../Resources/xlf/PlatformResources.ko.xlf | 2 +- .../Resources/xlf/PlatformResources.pl.xlf | 2 +- .../Resources/xlf/PlatformResources.pt-BR.xlf | 2 +- .../Resources/xlf/PlatformResources.ru.xlf | 2 +- .../Resources/xlf/PlatformResources.tr.xlf | 2 +- .../xlf/PlatformResources.zh-Hans.xlf | 2 +- .../xlf/PlatformResources.zh-Hant.xlf | 2 +- .../TimeoutTests.cs | 6 ++--- .../Helpers/TimeSpanParserTests.cs | 25 +++++++++++++------ 17 files changed, 36 insertions(+), 27 deletions(-) diff --git a/src/Platform/Microsoft.Testing.Platform/Helpers/TimeSpanParser.cs b/src/Platform/Microsoft.Testing.Platform/Helpers/TimeSpanParser.cs index 48c7ed85c3..8bf6d82e7c 100644 --- a/src/Platform/Microsoft.Testing.Platform/Helpers/TimeSpanParser.cs +++ b/src/Platform/Microsoft.Testing.Platform/Helpers/TimeSpanParser.cs @@ -21,10 +21,10 @@ internal static partial class TimeSpanParser private static readonly Regex Pattern = GetRegex(); #if NET7_0_OR_GREATER - [GeneratedRegex(@"^(?\d+(?:\.\d+)?)\s*(?ms|mils?|milliseconds?|s|secs?|seconds?|m|mins?|minutes?|h|hours?|d|days?)?$", RegexOptions.IgnoreCase)] + [GeneratedRegex(@"^(?\d+(?:\.\d+)?)(?:\s*(?ms|mils?|milliseconds?|s|secs?|seconds?|m|mins?|minutes?|h|hours?|d|days?))?$", RegexOptions.IgnoreCase)] private static partial Regex GetRegex(); #else - private static Regex GetRegex() => new(@"^(?\d+(?:\.\d+)?)\s*(?ms|mils?|milliseconds?|s|secs?|seconds?|m|mins?|minutes?|h|hours?|d|days?)?$", RegexOptions.IgnoreCase); + private static Regex GetRegex() => new(@"^(?\d+(?:\.\d+)?)(?:\s*(?ms|mils?|milliseconds?|s|secs?|seconds?|m|mins?|minutes?|h|hours?|d|days?))?$", RegexOptions.IgnoreCase); #endif public static TimeSpan Parse(string? time) => Parse(time, TimeSpanDefaultUnit.Milliseconds); diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/PlatformResources.resx b/src/Platform/Microsoft.Testing.Platform/Resources/PlatformResources.resx index f51a93486b..afcde59f55 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/PlatformResources.resx +++ b/src/Platform/Microsoft.Testing.Platform/Resources/PlatformResources.resx @@ -623,7 +623,7 @@ Valid values are 'All', 'Failed', 'None'. Default is 'All'. --show-stdout and --show-stderr expect a single parameter with value 'All', 'Failed', or 'None'. - 'timeout' option should have one argument as a time value with an explicit unit suffix, e.g. '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) + 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Examples: '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) A global test execution timeout. diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.cs.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.cs.xlf index 5b0b4350cf..74c1319292 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.cs.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.cs.xlf @@ -654,7 +654,7 @@ Výchozí hodnota je TestResults v adresáři, který obsahuje testovací aplika - 'timeout' option should have one argument as a time value with an explicit unit suffix, e.g. '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) + 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Examples: '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) Možnost timeout by měla mít jeden argument jako řetězec ve formátu <value>[h|m|s], kde value je hodnota datového typu float. diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.de.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.de.xlf index ab86b109c8..025c33ae97 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.de.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.de.xlf @@ -654,7 +654,7 @@ Der Standardwert ist "TestResults" im Verzeichnis, das die Testanwendung enthäl - 'timeout' option should have one argument as a time value with an explicit unit suffix, e.g. '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) + 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Examples: '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) Die Option "timeout" muss ein Argument als Zeichenfolge im Format <value>[h|m|s] aufweisen, wobei "value" auf "float" festgelegt ist. diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.es.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.es.xlf index 325e1620ef..7f61d4aeac 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.es.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.es.xlf @@ -654,7 +654,7 @@ El valor predeterminado es TestResults en el directorio que contiene la aplicaci - 'timeout' option should have one argument as a time value with an explicit unit suffix, e.g. '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) + 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Examples: '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) La opción 'timeout' debe tener un argumento como cadena con el formato <value>[h|m|s] donde 'value' es float diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.fr.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.fr.xlf index 34f17c675e..c1ad74f524 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.fr.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.fr.xlf @@ -654,7 +654,7 @@ La valeur par défaut est TestResults dans le répertoire qui contient l’appli - 'timeout' option should have one argument as a time value with an explicit unit suffix, e.g. '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) + 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Examples: '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) L’option « timeout » doit avoir un argument sous forme de chaîne au format <value>[h|m|s] où « value » est float diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.it.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.it.xlf index d834bc51a9..2b8c223e66 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.it.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.it.xlf @@ -654,7 +654,7 @@ L’impostazione predefinita è TestResults nella directory che contiene l'appli - 'timeout' option should have one argument as a time value with an explicit unit suffix, e.g. '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) + 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Examples: '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) L'opzione 'timeout' deve contenere un argomento come stringa nel formato <value>[h|m|s] dove 'value' è float diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ja.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ja.xlf index 265a56956d..c989f89c74 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ja.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ja.xlf @@ -655,7 +655,7 @@ The default is TestResults in the directory that contains the test application.< - 'timeout' option should have one argument as a time value with an explicit unit suffix, e.g. '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) + 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Examples: '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) 'timeout' オプションには、1 つの引数を文字列として <value>[h|m|s] の形式で指定する必要があります。この場合、'value' は float です diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ko.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ko.xlf index 43a7933678..639d15f1bd 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ko.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ko.xlf @@ -654,7 +654,7 @@ The default is TestResults in the directory that contains the test application.< - 'timeout' option should have one argument as a time value with an explicit unit suffix, e.g. '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) + 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Examples: '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) 'timeout' 옵션에는 'value'가 float인 <value>[h|m|s] 형식의 문자열로 인수가 하나 있어야 합니다. diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.pl.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.pl.xlf index bb1c6d4cb4..e93b80919d 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.pl.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.pl.xlf @@ -654,7 +654,7 @@ Wartość domyślna to TestResults w katalogu zawierającym aplikację testową. - 'timeout' option should have one argument as a time value with an explicit unit suffix, e.g. '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) + 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Examples: '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) Opcja „timeout” powinna mieć jeden argument jako ciąg w formacie <value>[h|m|s], gdzie element „value” ma wartość zmiennoprzecinkową diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.pt-BR.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.pt-BR.xlf index 60affedd2f..c5eeb9afa4 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.pt-BR.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.pt-BR.xlf @@ -654,7 +654,7 @@ O padrão é TestResults no diretório que contém o aplicativo de teste. - 'timeout' option should have one argument as a time value with an explicit unit suffix, e.g. '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) + 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Examples: '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) A opção 'timeout' deve ter um argumento como cadeia de caracteres no formato <value>[h|m|s] onde 'value' é float diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ru.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ru.xlf index 55225172aa..93bbdd0632 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ru.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ru.xlf @@ -654,7 +654,7 @@ The default is TestResults in the directory that contains the test application.< - 'timeout' option should have one argument as a time value with an explicit unit suffix, e.g. '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) + 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Examples: '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) Параметр "timeout" должен иметь один аргумент в виде строки в формате <value>[h|m|s], где "value" — число с плавающей точкой diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.tr.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.tr.xlf index eec63d4d39..52d69af851 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.tr.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.tr.xlf @@ -654,7 +654,7 @@ Varsayılan değer, test uygulamasını içeren dizindeki TestResults'dır. - 'timeout' option should have one argument as a time value with an explicit unit suffix, e.g. '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) + 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Examples: '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) 'timeout' seçeneği, 'value' değerinin kayan olduğu <value>[h|m|s] biçiminde dize olarak bir bağımsız değişkene sahip olmalıdır diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.zh-Hans.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.zh-Hans.xlf index ced0f2c455..197434204d 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.zh-Hans.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.zh-Hans.xlf @@ -654,7 +654,7 @@ The default is TestResults in the directory that contains the test application.< - 'timeout' option should have one argument as a time value with an explicit unit suffix, e.g. '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) + 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Examples: '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) "timeout" 选项应有一个字符串形式的参数,格式为 <value>[h|m|s],其中 "value" 为浮点型 diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.zh-Hant.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.zh-Hant.xlf index b180f19925..e1beb71186 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.zh-Hant.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.zh-Hant.xlf @@ -654,7 +654,7 @@ The default is TestResults in the directory that contains the test application.< - 'timeout' option should have one argument as a time value with an explicit unit suffix, e.g. '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) + 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Examples: '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) 'timeout' 選項應該有一個引數作為字串,格式為 <value>[h|m|s],其中 'value' 為 float diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutTests.cs index 5f59c7e7db..3155c15884 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutTests.cs @@ -18,7 +18,7 @@ public async Task TimeoutWithInvalidArg_WithoutLetterSuffix_OutputInvalidMessage TestHostResult testHostResult = await testHost.ExecuteAsync("--timeout 5", cancellationToken: TestContext.CancellationToken); testHostResult.AssertExitCodeIs(ExitCode.InvalidCommandLine); - testHostResult.AssertOutputContains("'timeout' option should have one argument as string in the format [h|m|s] where 'value' is float"); + testHostResult.AssertOutputContains("'timeout' option should have one argument as a time value with an explicit unit suffix"); } [TestMethod] @@ -29,7 +29,7 @@ public async Task TimeoutWithInvalidArg_WithInvalidLetterSuffix_OutputInvalidMes TestHostResult testHostResult = await testHost.ExecuteAsync("--timeout 5y", cancellationToken: TestContext.CancellationToken); testHostResult.AssertExitCodeIs(ExitCode.InvalidCommandLine); - testHostResult.AssertOutputContains("'timeout' option should have one argument as string in the format [h|m|s] where 'value' is float"); + testHostResult.AssertOutputContains("'timeout' option should have one argument as a time value with an explicit unit suffix"); } [TestMethod] @@ -40,7 +40,7 @@ public async Task TimeoutWithInvalidArg_WithInvalidFormat_OutputInvalidMessage(s TestHostResult testHostResult = await testHost.ExecuteAsync("--timeout 5h6m", cancellationToken: TestContext.CancellationToken); testHostResult.AssertExitCodeIs(ExitCode.InvalidCommandLine); - testHostResult.AssertOutputContains("'timeout' option should have one argument as string in the format [h|m|s] where 'value' is float"); + testHostResult.AssertOutputContains("'timeout' option should have one argument as a time value with an explicit unit suffix"); } [TestMethod] diff --git a/test/UnitTests/Microsoft.Testing.Platform.UnitTests/Helpers/TimeSpanParserTests.cs b/test/UnitTests/Microsoft.Testing.Platform.UnitTests/Helpers/TimeSpanParserTests.cs index 9236bd529d..0dcc964dda 100644 --- a/test/UnitTests/Microsoft.Testing.Platform.UnitTests/Helpers/TimeSpanParserTests.cs +++ b/test/UnitTests/Microsoft.Testing.Platform.UnitTests/Helpers/TimeSpanParserTests.cs @@ -179,18 +179,27 @@ public void Parse_ValidInput_ReturnsCorrectTimeSpan() } [TestMethod] - [DataRow("1S")] // uppercase single-char suffix - [DataRow("1M")] - [DataRow("1H")] - [DataRow("1D")] - [DataRow("1Hour")] // mixed case long form - [DataRow("1MINUTES")] // upper case long form - public void TryParse_UppercaseSuffix_ParsesCorrectly(string input) + [DataRow("1S", 1, "s")] // uppercase single-char suffix + [DataRow("1M", 1, "m")] + [DataRow("1H", 1, "h")] + [DataRow("1D", 1, "d")] + [DataRow("1Hour", 1, "h")] // mixed case long form + [DataRow("1MINUTES", 1, "m")] // upper case long form + public void TryParse_UppercaseSuffix_ParsesCorrectly(string input, double expectedValue, string expectedUnit) { bool result = TimeSpanParser.TryParse(input, out TimeSpan value); Assert.IsTrue(result); - Assert.AreNotEqual(TimeSpan.Zero, value); + TimeSpan expected = expectedUnit switch + { + "ms" => TimeSpan.FromMilliseconds(expectedValue), + "s" => TimeSpan.FromSeconds(expectedValue), + "m" => TimeSpan.FromMinutes(expectedValue), + "h" => TimeSpan.FromHours(expectedValue), + "d" => TimeSpan.FromDays(expectedValue), + _ => throw new ArgumentException($"Unknown unit '{expectedUnit}'", nameof(expectedUnit)), + }; + Assert.AreEqual(expected, value); } [TestMethod] From c9f2d395195125ff525de388f184088c2cee5c00 Mon Sep 17 00:00:00 2001 From: Copilot <223556219+Copilot@users.noreply.github.com> Date: Mon, 25 May 2026 16:56:27 +0200 Subject: [PATCH 3/6] Fix botched merge conflict resolution in PlatformResources Remove duplicate /+ entries for PlatformCommandLineTimeoutArgumentErrorMessage left over from merging origin/main, which caused 'trans-unit has invalid child element source' build errors. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Microsoft.Testing.Platform/Resources/PlatformResources.resx | 1 - .../Resources/xlf/PlatformResources.cs.xlf | 2 -- .../Resources/xlf/PlatformResources.de.xlf | 2 -- .../Resources/xlf/PlatformResources.es.xlf | 2 -- .../Resources/xlf/PlatformResources.fr.xlf | 2 -- .../Resources/xlf/PlatformResources.it.xlf | 2 -- .../Resources/xlf/PlatformResources.ja.xlf | 2 -- .../Resources/xlf/PlatformResources.ko.xlf | 2 -- .../Resources/xlf/PlatformResources.pl.xlf | 2 -- .../Resources/xlf/PlatformResources.pt-BR.xlf | 2 -- .../Resources/xlf/PlatformResources.ru.xlf | 2 -- .../Resources/xlf/PlatformResources.tr.xlf | 2 -- .../Resources/xlf/PlatformResources.zh-Hans.xlf | 2 -- .../Resources/xlf/PlatformResources.zh-Hant.xlf | 2 -- 14 files changed, 27 deletions(-) diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/PlatformResources.resx b/src/Platform/Microsoft.Testing.Platform/Resources/PlatformResources.resx index c652fabd53..3f18607cb2 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/PlatformResources.resx +++ b/src/Platform/Microsoft.Testing.Platform/Resources/PlatformResources.resx @@ -654,7 +654,6 @@ Valid values are 'All', 'Failed', 'None'. Default is 'All'. 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Examples: '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) - 'timeout' option should have one argument as string in the format <value>[h|m|s] where 'value' is a finite, non-negative number that does not exceed the maximum supported duration A global test execution timeout. diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.cs.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.cs.xlf index b52725a5c1..f695720617 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.cs.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.cs.xlf @@ -676,8 +676,6 @@ Výchozí hodnota je TestResults v adresáři, který obsahuje testovací aplika 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Examples: '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) Možnost timeout by měla mít jeden argument jako řetězec ve formátu <value>[h|m|s], kde value je hodnota datového typu float. - 'timeout' option should have one argument as string in the format <value>[h|m|s] where 'value' is a finite, non-negative number that does not exceed the maximum supported duration - Možnost timeout musí mít jeden argument ve formátu řetězce <value>[h|m|s], kde value je konečné nezáporné číslo, které nepřekračuje maximální podporovanou dobu trvání. diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.de.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.de.xlf index cf7fd6524d..46d93563ea 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.de.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.de.xlf @@ -676,8 +676,6 @@ Der Standardwert ist "TestResults" im Verzeichnis, das die Testanwendung enthäl 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Examples: '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) Die Option "timeout" muss ein Argument als Zeichenfolge im Format <value>[h|m|s] aufweisen, wobei "value" auf "float" festgelegt ist. - 'timeout' option should have one argument as string in the format <value>[h|m|s] where 'value' is a finite, non-negative number that does not exceed the maximum supported duration - Die Option „timeout“ sollte genau ein Argument als Zeichenfolge im Format <value>[h|m|s] haben, wobei „value“ eine endliche, nicht negative Zahl ist, die die maximal unterstützte Dauer nicht überschreitet diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.es.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.es.xlf index 6890089776..38dbf47eda 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.es.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.es.xlf @@ -676,8 +676,6 @@ El valor predeterminado es TestResults en el directorio que contiene la aplicaci 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Examples: '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) La opción 'timeout' debe tener un argumento como cadena con el formato <value>[h|m|s] donde 'value' es float - 'timeout' option should have one argument as string in the format <value>[h|m|s] where 'value' is a finite, non-negative number that does not exceed the maximum supported duration - La opción "timeout" debe tener un único argumento como cadena con el formato <value>[h|m|s], donde "value" es un número finito y no negativo que no supera la duración máxima admitida diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.fr.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.fr.xlf index 41a665f805..aeea7848a0 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.fr.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.fr.xlf @@ -676,8 +676,6 @@ La valeur par défaut est TestResults dans le répertoire qui contient l’appli 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Examples: '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) L’option « timeout » doit avoir un argument sous forme de chaîne au format <value>[h|m|s] où « value » est float - 'timeout' option should have one argument as string in the format <value>[h|m|s] where 'value' is a finite, non-negative number that does not exceed the maximum supported duration - L’option « timeout » doit avoir un argument sous forme de chaîne au format <value>[h|m|s], où « value » est un nombre fini, non négatif, qui ne dépasse pas la durée maximale prise en charge diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.it.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.it.xlf index e3e21046ca..7b18dadd9e 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.it.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.it.xlf @@ -676,8 +676,6 @@ L’impostazione predefinita è TestResults nella directory che contiene l'appli 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Examples: '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) L'opzione 'timeout' deve contenere un argomento come stringa nel formato <value>[h|m|s] dove 'value' è float - 'timeout' option should have one argument as string in the format <value>[h|m|s] where 'value' is a finite, non-negative number that does not exceed the maximum supported duration - L'opzione 'timeout' deve avere un argomento di tipo stringa nel formato <value>[h|m|s], in cui 'value' è un numero finito non negativo che non supera la durata massima supportata diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ja.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ja.xlf index ef21ac8cdb..3eb16f4663 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ja.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ja.xlf @@ -677,8 +677,6 @@ The default is TestResults in the directory that contains the test application.< 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Examples: '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) 'timeout' オプションには、1 つの引数を文字列として <value>[h|m|s] の形式で指定する必要があります。この場合、'value' は float です - 'timeout' option should have one argument as string in the format <value>[h|m|s] where 'value' is a finite, non-negative number that does not exceed the maximum supported duration - 'timeout' オプションには、1 つの引数を <value>[h|m|s] 形式の文字列として指定する必要があります。ここで 'value' は、サポートされる最大継続時間を超えない、負でない有限の数値です diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ko.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ko.xlf index ec9eec86d9..cc7f7beecb 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ko.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ko.xlf @@ -676,8 +676,6 @@ The default is TestResults in the directory that contains the test application.< 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Examples: '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) 'timeout' 옵션에는 'value'가 float인 <value>[h|m|s] 형식의 문자열로 인수가 하나 있어야 합니다. - 'timeout' option should have one argument as string in the format <value>[h|m|s] where 'value' is a finite, non-negative number that does not exceed the maximum supported duration - 'timeout' 옵션에는 <value>[h|m|s] 형식의 문자열 인수가 하나 필요합니다. 'value'는 지원되는 최대 기간을 초과하지 않는 유한한 음이 아닌 숫자여야 합니다. diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.pl.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.pl.xlf index 5ffb7a7285..a7d10d1532 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.pl.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.pl.xlf @@ -676,8 +676,6 @@ Wartość domyślna to TestResults w katalogu zawierającym aplikację testową. 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Examples: '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) Opcja „timeout” powinna mieć jeden argument jako ciąg w formacie <value>[h|m|s], gdzie element „value” ma wartość zmiennoprzecinkową - 'timeout' option should have one argument as string in the format <value>[h|m|s] where 'value' is a finite, non-negative number that does not exceed the maximum supported duration - Opcja „timeout” powinna mieć jeden argument jako ciąg w formacie <value>[h|m|s], gdzie „value” jest skończoną, nieujemną liczbą, która nie przekracza maksymalnego obsługiwanego czasu trwania diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.pt-BR.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.pt-BR.xlf index e4630c7822..3a7e4e7429 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.pt-BR.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.pt-BR.xlf @@ -676,8 +676,6 @@ O padrão é TestResults no diretório que contém o aplicativo de teste. 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Examples: '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) A opção 'timeout' deve ter um argumento como cadeia de caracteres no formato <value>[h|m|s] onde 'value' é float - 'timeout' option should have one argument as string in the format <value>[h|m|s] where 'value' is a finite, non-negative number that does not exceed the maximum supported duration - 'timeout' option should have one argument as string in the format <value>[h|m|s] where 'value' is a finite, non-negative number that does not exceed the maximum supported duration diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ru.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ru.xlf index 06235e64eb..75af9a3c63 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ru.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ru.xlf @@ -676,8 +676,6 @@ The default is TestResults in the directory that contains the test application.< 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Examples: '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) Параметр "timeout" должен иметь один аргумент в виде строки в формате <value>[h|m|s], где "value" — число с плавающей точкой - 'timeout' option should have one argument as string in the format <value>[h|m|s] where 'value' is a finite, non-negative number that does not exceed the maximum supported duration - Параметр "timeout" должен принимать один аргумент в виде строки в формате <value>[h|m|s], где "value" — конечное неотрицательное число, не превышающее максимальную поддерживаемую длительность diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.tr.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.tr.xlf index 964e5e90c1..3372abe2d9 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.tr.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.tr.xlf @@ -676,8 +676,6 @@ Varsayılan değer, test uygulamasını içeren dizindeki TestResults'dır. 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Examples: '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) 'timeout' seçeneği, 'value' değerinin kayan olduğu <value>[h|m|s] biçiminde dize olarak bir bağımsız değişkene sahip olmalıdır - 'timeout' option should have one argument as string in the format <value>[h|m|s] where 'value' is a finite, non-negative number that does not exceed the maximum supported duration - 'timeout' seçeneğinin <value>[h|m|s] biçiminde dize olarak bir bağımsız değişkeni olmalıdır; 'value' burada desteklenen maksimum süreyi aşmayan sonlu, negatif olmayan bir sayıdır diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.zh-Hans.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.zh-Hans.xlf index 396a74d7a7..b0e86153dc 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.zh-Hans.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.zh-Hans.xlf @@ -676,8 +676,6 @@ The default is TestResults in the directory that contains the test application.< 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Examples: '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) "timeout" 选项应有一个字符串形式的参数,格式为 <value>[h|m|s],其中 "value" 为浮点型 - 'timeout' option should have one argument as string in the format <value>[h|m|s] where 'value' is a finite, non-negative number that does not exceed the maximum supported duration - “超时”选项应有一个字符串类型的参数,格式为 <value>[h|m|s],其中 "value" 是一个有限的非负数,且不超过支持的最大持续时间 diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.zh-Hant.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.zh-Hant.xlf index 096ad692ba..0e0d1de320 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.zh-Hant.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.zh-Hant.xlf @@ -676,8 +676,6 @@ The default is TestResults in the directory that contains the test application.< 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Examples: '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) 'timeout' 選項應該有一個引數作為字串,格式為 <value>[h|m|s],其中 'value' 為 float - 'timeout' option should have one argument as string in the format <value>[h|m|s] where 'value' is a finite, non-negative number that does not exceed the maximum supported duration - 'timeout' option should have one argument as string in the format <value>[h|m|s] where 'value' is a finite, non-negative number that does not exceed the maximum supported duration From f7ed0895fe94313ab7b92bbdb8c8f3ca38ec675b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amaury=20Lev=C3=A9?= Date: Mon, 25 May 2026 17:41:44 +0200 Subject: [PATCH 4/6] Address review feedback: culture-invariant regex, centralize MaxSupportedTimeout, remove dead TryParseTimeoutArgument Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../PlatformCommandLineProvider.cs | 49 ++----------------- .../Helpers/TaskExtensions.cs | 8 +-- .../Helpers/TimeSpanParser.cs | 4 +- 3 files changed, 11 insertions(+), 50 deletions(-) diff --git a/src/Platform/Microsoft.Testing.Platform/CommandLine/PlatformCommandLineProvider.cs b/src/Platform/Microsoft.Testing.Platform/CommandLine/PlatformCommandLineProvider.cs index ce71a340f0..6770e0c071 100644 --- a/src/Platform/Microsoft.Testing.Platform/CommandLine/PlatformCommandLineProvider.cs +++ b/src/Platform/Microsoft.Testing.Platform/CommandLine/PlatformCommandLineProvider.cs @@ -127,13 +127,13 @@ public Task ValidateOptionArgumentsAsync(CommandLineOption com } // CancellationTokenSource.CancelAfter caps at Timer.MaxSupportedTimeout - // (uint.MaxValue - 1 ms, ~49.7 days). Reject values above that range here so the - // user gets a friendly CLI error instead of an ArgumentOutOfRangeException from - // CancelAfter when the value is consumed later. + // (~49.7 days). Reject values above that range here so the user gets a friendly + // CLI error instead of an ArgumentOutOfRangeException from CancelAfter when the + // value is consumed later. if (commandOption.Name == TimeoutOptionKey && (!TimeSpanParser.TryParseRequireSuffix(arguments[0], out TimeSpan timeout) || timeout <= TimeSpan.Zero - || timeout.TotalMilliseconds > uint.MaxValue - 1)) + || timeout.TotalMilliseconds > Helpers.TaskExtensions.MaxSupportedTimeoutMs)) { return ValidationResult.InvalidTask(PlatformResources.PlatformCommandLineTimeoutArgumentErrorMessage); } @@ -184,47 +184,6 @@ private static Task IsMinimumExpectedTestsOptionValidAsync(Com ? ValidationResult.InvalidTask(PlatformResources.PlatformCommandLineMinimumExpectedTestsOptionSingleArgument) : ValidationResult.ValidTask; - internal static bool TryParseTimeoutArgument(string arg, out TimeSpan timeout) - { - timeout = TimeSpan.Zero; - - if (arg is null || arg.Length < 2) - { - return false; - } - - char unit = char.ToLowerInvariant(arg[^1]); - if (unit is not ('h' or 'm' or 's')) - { - return false; - } - - if (!float.TryParse(arg[..^1], NumberStyles.Float, CultureInfo.InvariantCulture, out float value) - || float.IsNaN(value) - || float.IsInfinity(value) - || value < 0) - { - return false; - } - - try - { - timeout = unit switch - { - 'h' => TimeSpan.FromHours(value), - 'm' => TimeSpan.FromMinutes(value), - 's' => TimeSpan.FromSeconds(value), - _ => throw ApplicationStateGuard.Unreachable(), - }; - } - catch (OverflowException) - { - return false; - } - - return true; - } - public Task ValidateCommandLineOptionsAsync(ICommandLineOptions commandLineOptions) { if (!commandLineOptions.IsOptionSet(DiagnosticOptionKey)) diff --git a/src/Platform/Microsoft.Testing.Platform/Helpers/TaskExtensions.cs b/src/Platform/Microsoft.Testing.Platform/Helpers/TaskExtensions.cs index 925928da13..f8a5c17114 100644 --- a/src/Platform/Microsoft.Testing.Platform/Helpers/TaskExtensions.cs +++ b/src/Platform/Microsoft.Testing.Platform/Helpers/TaskExtensions.cs @@ -6,9 +6,11 @@ namespace Microsoft.Testing.Platform.Helpers; // The idea was taken from https://github.com/dotnet/aspnetcore/blob/main/src/Shared/TaskExtensions.cs internal static class TaskExtensions { -#if !NETCOREAPP - private const uint MaxSupportedTimeout = 0xfffffffe; + // CancellationTokenSource.CancelAfter / Timer.Change cap at this many milliseconds + // (~49.7 days). This matches the runtime's internal Timer.MaxSupportedTimeout constant. + public const long MaxSupportedTimeoutMs = 0xfffffffe; +#if !NETCOREAPP public static Task WaitAsync(this Task target, CancellationToken cancellationToken) => target.WaitAsync(Timeout.InfiniteTimeSpan, cancellationToken); @@ -23,7 +25,7 @@ public static async Task WaitAsync( CancellationToken cancellationToken) { long milliseconds = (long)timeout.TotalMilliseconds; - if (milliseconds is < -1 or > MaxSupportedTimeout) + if (milliseconds is < -1 or > MaxSupportedTimeoutMs) { throw new ArgumentOutOfRangeException(nameof(timeout)); } diff --git a/src/Platform/Microsoft.Testing.Platform/Helpers/TimeSpanParser.cs b/src/Platform/Microsoft.Testing.Platform/Helpers/TimeSpanParser.cs index 8bf6d82e7c..6bc6d50349 100644 --- a/src/Platform/Microsoft.Testing.Platform/Helpers/TimeSpanParser.cs +++ b/src/Platform/Microsoft.Testing.Platform/Helpers/TimeSpanParser.cs @@ -21,10 +21,10 @@ internal static partial class TimeSpanParser private static readonly Regex Pattern = GetRegex(); #if NET7_0_OR_GREATER - [GeneratedRegex(@"^(?\d+(?:\.\d+)?)(?:\s*(?ms|mils?|milliseconds?|s|secs?|seconds?|m|mins?|minutes?|h|hours?|d|days?))?$", RegexOptions.IgnoreCase)] + [GeneratedRegex(@"^(?\d+(?:\.\d+)?)(?:\s*(?ms|mils?|milliseconds?|s|secs?|seconds?|m|mins?|minutes?|h|hours?|d|days?))?$", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant)] private static partial Regex GetRegex(); #else - private static Regex GetRegex() => new(@"^(?\d+(?:\.\d+)?)(?:\s*(?ms|mils?|milliseconds?|s|secs?|seconds?|m|mins?|minutes?|h|hours?|d|days?))?$", RegexOptions.IgnoreCase); + private static Regex GetRegex() => new(@"^(?\d+(?:\.\d+)?)(?:\s*(?ms|mils?|milliseconds?|s|secs?|seconds?|m|mins?|minutes?|h|hours?|d|days?))?$", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant); #endif public static TimeSpan Parse(string? time) => Parse(time, TimeSpanDefaultUnit.Milliseconds); From 26e7b268a9e240b9e3e3265eaf54ac50053a9321 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amaury=20Lev=C3=A9?= Date: Mon, 25 May 2026 23:14:53 +0200 Subject: [PATCH 5/6] Document --timeout suffix aliases (mil/sec/min) in help text Address PR #8506 review: the TimeSpanParser regex accepts mil/mils/sec/secs/min/mins short-form aliases but they were not documented in the --timeout help text or error message, leading users to think only 'ms'/'s'/'m'/'h'/'d' were valid. Align the --timeout description and error message with the existing HangDump style by listing all accepted suffixes exhaustively. - Update PlatformCommandLineTimeoutOptionDescription and PlatformCommandLineTimeoutArgumentErrorMessage to list every accepted suffix. - Update TimeSpanParser.SuffixGrammar (used by other consumers via GetGrammarHint) to keep the wording consistent. - Update HelpInfo* acceptance test expectations to match. - Add TimeoutWithValidArg_WithAliasSuffix integration test pinning that '500mil' flows through the --timeout option (not just the shared parser). - Fix a pre-existing test/resx mismatch for --retry-failed-tests-delay in HelpInfoAllExtensionsTests that was introduced earlier in this PR. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Helpers/TimeSpanParser.cs | 2 +- .../Resources/PlatformResources.resx | 4 ++-- .../Resources/xlf/PlatformResources.cs.xlf | 4 ++-- .../Resources/xlf/PlatformResources.de.xlf | 4 ++-- .../Resources/xlf/PlatformResources.es.xlf | 4 ++-- .../Resources/xlf/PlatformResources.fr.xlf | 4 ++-- .../Resources/xlf/PlatformResources.it.xlf | 4 ++-- .../Resources/xlf/PlatformResources.ja.xlf | 4 ++-- .../Resources/xlf/PlatformResources.ko.xlf | 4 ++-- .../Resources/xlf/PlatformResources.pl.xlf | 4 ++-- .../Resources/xlf/PlatformResources.pt-BR.xlf | 4 ++-- .../Resources/xlf/PlatformResources.ru.xlf | 4 ++-- .../Resources/xlf/PlatformResources.tr.xlf | 4 ++-- .../Resources/xlf/PlatformResources.zh-Hans.xlf | 4 ++-- .../Resources/xlf/PlatformResources.zh-Hant.xlf | 4 ++-- .../HelpInfoTests.cs | 2 +- .../HelpInfoAllExtensionsTests.cs | 6 +++--- .../HelpInfoTests.cs | 4 ++-- .../TimeoutTests.cs | 13 +++++++++++++ 19 files changed, 48 insertions(+), 35 deletions(-) diff --git a/src/Platform/Microsoft.Testing.Platform/Helpers/TimeSpanParser.cs b/src/Platform/Microsoft.Testing.Platform/Helpers/TimeSpanParser.cs index 6bc6d50349..1f0aa11e22 100644 --- a/src/Platform/Microsoft.Testing.Platform/Helpers/TimeSpanParser.cs +++ b/src/Platform/Microsoft.Testing.Platform/Helpers/TimeSpanParser.cs @@ -158,7 +158,7 @@ private static FormatException GetFormatException(string? value, TimeSpanDefault private static string GetGrammarHint(TimeSpanDefaultUnit? defaultUnit, bool requireSuffix) { - const string SuffixGrammar = "Use [ms|s|m|h|d] (long forms 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted), e.g. '500ms', '5400s', '90m', '1.5h', '1d'."; + const string SuffixGrammar = "Accepted suffixes are 'ms'/'mil(s)'/'millisecond(s)', 's'/'sec(s)'/'second(s)', 'm'/'min(s)'/'minute(s)', 'h'/'hour(s)', and 'd'/'day(s)', e.g. '500ms', '5400s', '90m', '1.5h', '1d'."; return requireSuffix || defaultUnit is null ? SuffixGrammar + " A unit suffix is required." : SuffixGrammar + $" A bare number defaults to {defaultUnit.Value.ToString().ToLowerInvariant()}."; diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/PlatformResources.resx b/src/Platform/Microsoft.Testing.Platform/Resources/PlatformResources.resx index 3f18607cb2..56b7fe78c6 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/PlatformResources.resx +++ b/src/Platform/Microsoft.Testing.Platform/Resources/PlatformResources.resx @@ -653,11 +653,11 @@ Valid values are 'All', 'Failed', 'None'. Default is 'All'. --show-stdout and --show-stderr expect a single parameter with value 'All', 'Failed', or 'None'. - 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Examples: '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) + 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Accepted suffixes are 'ms'/'mil(s)'/'millisecond(s)', 's'/'sec(s)'/'second(s)', 'm'/'min(s)'/'minute(s)', 'h'/'hour(s)', and 'd'/'day(s)', e.g. '500ms', '5400s', '90m', '1.5h', '1d'. A global test execution timeout. -Takes one argument as a time value with an explicit unit suffix. Accepted units are 'ms', 's', 'm', 'h', 'd' (long forms 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted), e.g. '500ms', '5400s', '90m', '1.5h', '1d'. +Takes one argument as a time value with an explicit unit suffix. Accepted suffixes are 'ms'/'mil(s)'/'millisecond(s)', 's'/'sec(s)'/'second(s)', 'm'/'min(s)'/'minute(s)', 'h'/'hour(s)', and 'd'/'day(s)', e.g. '500ms', '5400s', '90m', '1.5h', '1d'. The ILoggerFactory has not been built yet. diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.cs.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.cs.xlf index f695720617..e5b3c8e27f 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.cs.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.cs.xlf @@ -674,13 +674,13 @@ Výchozí hodnota je TestResults v adresáři, který obsahuje testovací aplika - 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Examples: '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) + 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Accepted suffixes are 'ms'/'mil(s)'/'millisecond(s)', 's'/'sec(s)'/'second(s)', 'm'/'min(s)'/'minute(s)', 'h'/'hour(s)', and 'd'/'day(s)', e.g. '500ms', '5400s', '90m', '1.5h', '1d'. Možnost timeout by měla mít jeden argument jako řetězec ve formátu <value>[h|m|s], kde value je hodnota datového typu float. A global test execution timeout. -Takes one argument as a time value with an explicit unit suffix. Accepted units are 'ms', 's', 'm', 'h', 'd' (long forms 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted), e.g. '500ms', '5400s', '90m', '1.5h', '1d'. +Takes one argument as a time value with an explicit unit suffix. Accepted suffixes are 'ms'/'mil(s)'/'millisecond(s)', 's'/'sec(s)'/'second(s)', 'm'/'min(s)'/'minute(s)', 'h'/'hour(s)', and 'd'/'day(s)', e.g. '500ms', '5400s', '90m', '1.5h', '1d'. Vypršel globální časový limit provádění testu. Může mít jenom jeden argument jako řetězec ve formátu <value>[h|m|s], kde value je hodnota datového typu float. diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.de.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.de.xlf index 46d93563ea..41e2bf9eac 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.de.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.de.xlf @@ -674,13 +674,13 @@ Der Standardwert ist "TestResults" im Verzeichnis, das die Testanwendung enthäl - 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Examples: '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) + 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Accepted suffixes are 'ms'/'mil(s)'/'millisecond(s)', 's'/'sec(s)'/'second(s)', 'm'/'min(s)'/'minute(s)', 'h'/'hour(s)', and 'd'/'day(s)', e.g. '500ms', '5400s', '90m', '1.5h', '1d'. Die Option "timeout" muss ein Argument als Zeichenfolge im Format <value>[h|m|s] aufweisen, wobei "value" auf "float" festgelegt ist. A global test execution timeout. -Takes one argument as a time value with an explicit unit suffix. Accepted units are 'ms', 's', 'm', 'h', 'd' (long forms 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted), e.g. '500ms', '5400s', '90m', '1.5h', '1d'. +Takes one argument as a time value with an explicit unit suffix. Accepted suffixes are 'ms'/'mil(s)'/'millisecond(s)', 's'/'sec(s)'/'second(s)', 'm'/'min(s)'/'minute(s)', 'h'/'hour(s)', and 'd'/'day(s)', e.g. '500ms', '5400s', '90m', '1.5h', '1d'. Eine globale Testausführungszeit. Nimmt ein Argument als Zeichenfolge im Format <value>[h|m|s], wobei "value" auf "float" festgelegt ist. diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.es.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.es.xlf index 38dbf47eda..7dc18172db 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.es.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.es.xlf @@ -674,13 +674,13 @@ El valor predeterminado es TestResults en el directorio que contiene la aplicaci - 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Examples: '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) + 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Accepted suffixes are 'ms'/'mil(s)'/'millisecond(s)', 's'/'sec(s)'/'second(s)', 'm'/'min(s)'/'minute(s)', 'h'/'hour(s)', and 'd'/'day(s)', e.g. '500ms', '5400s', '90m', '1.5h', '1d'. La opción 'timeout' debe tener un argumento como cadena con el formato <value>[h|m|s] donde 'value' es float A global test execution timeout. -Takes one argument as a time value with an explicit unit suffix. Accepted units are 'ms', 's', 'm', 'h', 'd' (long forms 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted), e.g. '500ms', '5400s', '90m', '1.5h', '1d'. +Takes one argument as a time value with an explicit unit suffix. Accepted suffixes are 'ms'/'mil(s)'/'millisecond(s)', 's'/'sec(s)'/'second(s)', 'm'/'min(s)'/'minute(s)', 'h'/'hour(s)', and 'd'/'day(s)', e.g. '500ms', '5400s', '90m', '1.5h', '1d'. Tiempo de espera de ejecución de prueba global. Toma un argumento como cadena con el formato <value>[h|m|s] donde 'value' es float. diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.fr.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.fr.xlf index aeea7848a0..d3d530c81c 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.fr.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.fr.xlf @@ -674,13 +674,13 @@ La valeur par défaut est TestResults dans le répertoire qui contient l’appli - 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Examples: '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) + 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Accepted suffixes are 'ms'/'mil(s)'/'millisecond(s)', 's'/'sec(s)'/'second(s)', 'm'/'min(s)'/'minute(s)', 'h'/'hour(s)', and 'd'/'day(s)', e.g. '500ms', '5400s', '90m', '1.5h', '1d'. L’option « timeout » doit avoir un argument sous forme de chaîne au format <value>[h|m|s] où « value » est float A global test execution timeout. -Takes one argument as a time value with an explicit unit suffix. Accepted units are 'ms', 's', 'm', 'h', 'd' (long forms 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted), e.g. '500ms', '5400s', '90m', '1.5h', '1d'. +Takes one argument as a time value with an explicit unit suffix. Accepted suffixes are 'ms'/'mil(s)'/'millisecond(s)', 's'/'sec(s)'/'second(s)', 'm'/'min(s)'/'minute(s)', 'h'/'hour(s)', and 'd'/'day(s)', e.g. '500ms', '5400s', '90m', '1.5h', '1d'. Délai global d’exécution du test. Prend un argument sous forme de chaîne au format <value>[h|m|s] où « value » est float. diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.it.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.it.xlf index 7b18dadd9e..b6b4978e9b 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.it.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.it.xlf @@ -674,13 +674,13 @@ L’impostazione predefinita è TestResults nella directory che contiene l'appli - 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Examples: '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) + 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Accepted suffixes are 'ms'/'mil(s)'/'millisecond(s)', 's'/'sec(s)'/'second(s)', 'm'/'min(s)'/'minute(s)', 'h'/'hour(s)', and 'd'/'day(s)', e.g. '500ms', '5400s', '90m', '1.5h', '1d'. L'opzione 'timeout' deve contenere un argomento come stringa nel formato <value>[h|m|s] dove 'value' è float A global test execution timeout. -Takes one argument as a time value with an explicit unit suffix. Accepted units are 'ms', 's', 'm', 'h', 'd' (long forms 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted), e.g. '500ms', '5400s', '90m', '1.5h', '1d'. +Takes one argument as a time value with an explicit unit suffix. Accepted suffixes are 'ms'/'mil(s)'/'millisecond(s)', 's'/'sec(s)'/'second(s)', 'm'/'min(s)'/'minute(s)', 'h'/'hour(s)', and 'd'/'day(s)', e.g. '500ms', '5400s', '90m', '1.5h', '1d'. Un timeout di esecuzione test globale. Acquisisce un argomento come stringa nel formato <value>[h|m|s] dove 'value' è float. diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ja.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ja.xlf index 3eb16f4663..a3109e4ce9 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ja.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ja.xlf @@ -675,13 +675,13 @@ The default is TestResults in the directory that contains the test application.< - 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Examples: '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) + 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Accepted suffixes are 'ms'/'mil(s)'/'millisecond(s)', 's'/'sec(s)'/'second(s)', 'm'/'min(s)'/'minute(s)', 'h'/'hour(s)', and 'd'/'day(s)', e.g. '500ms', '5400s', '90m', '1.5h', '1d'. 'timeout' オプションには、1 つの引数を文字列として <value>[h|m|s] の形式で指定する必要があります。この場合、'value' は float です A global test execution timeout. -Takes one argument as a time value with an explicit unit suffix. Accepted units are 'ms', 's', 'm', 'h', 'd' (long forms 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted), e.g. '500ms', '5400s', '90m', '1.5h', '1d'. +Takes one argument as a time value with an explicit unit suffix. Accepted suffixes are 'ms'/'mil(s)'/'millisecond(s)', 's'/'sec(s)'/'second(s)', 'm'/'min(s)'/'minute(s)', 'h'/'hour(s)', and 'd'/'day(s)', e.g. '500ms', '5400s', '90m', '1.5h', '1d'. グローバル テスト実行のタイムアウト。 1 つの引数を文字列として <value>[h|m|s] の形式で使用します。この場合、'value' は float です。 diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ko.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ko.xlf index cc7f7beecb..dba56e407e 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ko.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ko.xlf @@ -674,13 +674,13 @@ The default is TestResults in the directory that contains the test application.< - 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Examples: '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) + 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Accepted suffixes are 'ms'/'mil(s)'/'millisecond(s)', 's'/'sec(s)'/'second(s)', 'm'/'min(s)'/'minute(s)', 'h'/'hour(s)', and 'd'/'day(s)', e.g. '500ms', '5400s', '90m', '1.5h', '1d'. 'timeout' 옵션에는 'value'가 float인 <value>[h|m|s] 형식의 문자열로 인수가 하나 있어야 합니다. A global test execution timeout. -Takes one argument as a time value with an explicit unit suffix. Accepted units are 'ms', 's', 'm', 'h', 'd' (long forms 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted), e.g. '500ms', '5400s', '90m', '1.5h', '1d'. +Takes one argument as a time value with an explicit unit suffix. Accepted suffixes are 'ms'/'mil(s)'/'millisecond(s)', 's'/'sec(s)'/'second(s)', 'm'/'min(s)'/'minute(s)', 'h'/'hour(s)', and 'd'/'day(s)', e.g. '500ms', '5400s', '90m', '1.5h', '1d'. 전역 테스트 실행 시간 제한입니다. 'value'가 float인 <value>[h|m|s] 형식의 문자열로 인수 하나를 사용합니다. diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.pl.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.pl.xlf index a7d10d1532..bdc0ae9fac 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.pl.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.pl.xlf @@ -674,13 +674,13 @@ Wartość domyślna to TestResults w katalogu zawierającym aplikację testową. - 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Examples: '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) + 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Accepted suffixes are 'ms'/'mil(s)'/'millisecond(s)', 's'/'sec(s)'/'second(s)', 'm'/'min(s)'/'minute(s)', 'h'/'hour(s)', and 'd'/'day(s)', e.g. '500ms', '5400s', '90m', '1.5h', '1d'. Opcja „timeout” powinna mieć jeden argument jako ciąg w formacie <value>[h|m|s], gdzie element „value” ma wartość zmiennoprzecinkową A global test execution timeout. -Takes one argument as a time value with an explicit unit suffix. Accepted units are 'ms', 's', 'm', 'h', 'd' (long forms 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted), e.g. '500ms', '5400s', '90m', '1.5h', '1d'. +Takes one argument as a time value with an explicit unit suffix. Accepted suffixes are 'ms'/'mil(s)'/'millisecond(s)', 's'/'sec(s)'/'second(s)', 'm'/'min(s)'/'minute(s)', 'h'/'hour(s)', and 'd'/'day(s)', e.g. '500ms', '5400s', '90m', '1.5h', '1d'. Limit czasu wykonywania testu globalnego. Pobiera jeden argument jako ciąg w formacie <value>[h|m|s], gdzie element „value” ma wartość zmiennoprzecinkową. diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.pt-BR.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.pt-BR.xlf index 3a7e4e7429..370ed8a1be 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.pt-BR.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.pt-BR.xlf @@ -674,13 +674,13 @@ O padrão é TestResults no diretório que contém o aplicativo de teste. - 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Examples: '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) + 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Accepted suffixes are 'ms'/'mil(s)'/'millisecond(s)', 's'/'sec(s)'/'second(s)', 'm'/'min(s)'/'minute(s)', 'h'/'hour(s)', and 'd'/'day(s)', e.g. '500ms', '5400s', '90m', '1.5h', '1d'. A opção 'timeout' deve ter um argumento como cadeia de caracteres no formato <value>[h|m|s] onde 'value' é float A global test execution timeout. -Takes one argument as a time value with an explicit unit suffix. Accepted units are 'ms', 's', 'm', 'h', 'd' (long forms 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted), e.g. '500ms', '5400s', '90m', '1.5h', '1d'. +Takes one argument as a time value with an explicit unit suffix. Accepted suffixes are 'ms'/'mil(s)'/'millisecond(s)', 's'/'sec(s)'/'second(s)', 'm'/'min(s)'/'minute(s)', 'h'/'hour(s)', and 'd'/'day(s)', e.g. '500ms', '5400s', '90m', '1.5h', '1d'. Um tempo limite global para a execução do teste. Recebe um argumento como cadeia de caracteres no formato <valor>[h|m|s] em que 'valor' é float. diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ru.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ru.xlf index 75af9a3c63..683b5bdb32 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ru.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ru.xlf @@ -674,13 +674,13 @@ The default is TestResults in the directory that contains the test application.< - 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Examples: '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) + 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Accepted suffixes are 'ms'/'mil(s)'/'millisecond(s)', 's'/'sec(s)'/'second(s)', 'm'/'min(s)'/'minute(s)', 'h'/'hour(s)', and 'd'/'day(s)', e.g. '500ms', '5400s', '90m', '1.5h', '1d'. Параметр "timeout" должен иметь один аргумент в виде строки в формате <value>[h|m|s], где "value" — число с плавающей точкой A global test execution timeout. -Takes one argument as a time value with an explicit unit suffix. Accepted units are 'ms', 's', 'm', 'h', 'd' (long forms 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted), e.g. '500ms', '5400s', '90m', '1.5h', '1d'. +Takes one argument as a time value with an explicit unit suffix. Accepted suffixes are 'ms'/'mil(s)'/'millisecond(s)', 's'/'sec(s)'/'second(s)', 'm'/'min(s)'/'minute(s)', 'h'/'hour(s)', and 'd'/'day(s)', e.g. '500ms', '5400s', '90m', '1.5h', '1d'. Глобальное время ожидания выполнения теста. Принимает один аргумент в виде строки в формате <value>[h|m|s], где "value" — число с плавающей точкой. diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.tr.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.tr.xlf index 3372abe2d9..64780bd89a 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.tr.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.tr.xlf @@ -674,13 +674,13 @@ Varsayılan değer, test uygulamasını içeren dizindeki TestResults'dır. - 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Examples: '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) + 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Accepted suffixes are 'ms'/'mil(s)'/'millisecond(s)', 's'/'sec(s)'/'second(s)', 'm'/'min(s)'/'minute(s)', 'h'/'hour(s)', and 'd'/'day(s)', e.g. '500ms', '5400s', '90m', '1.5h', '1d'. 'timeout' seçeneği, 'value' değerinin kayan olduğu <value>[h|m|s] biçiminde dize olarak bir bağımsız değişkene sahip olmalıdır A global test execution timeout. -Takes one argument as a time value with an explicit unit suffix. Accepted units are 'ms', 's', 'm', 'h', 'd' (long forms 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted), e.g. '500ms', '5400s', '90m', '1.5h', '1d'. +Takes one argument as a time value with an explicit unit suffix. Accepted suffixes are 'ms'/'mil(s)'/'millisecond(s)', 's'/'sec(s)'/'second(s)', 'm'/'min(s)'/'minute(s)', 'h'/'hour(s)', and 'd'/'day(s)', e.g. '500ms', '5400s', '90m', '1.5h', '1d'. Genel bir test yürütme zaman aşımı. Bir bağımsız değişkeni, 'value' değerinin kayan olduğu <value>[h|m|s] biçiminde dize olarak alır. diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.zh-Hans.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.zh-Hans.xlf index b0e86153dc..cb204620fa 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.zh-Hans.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.zh-Hans.xlf @@ -674,13 +674,13 @@ The default is TestResults in the directory that contains the test application.< - 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Examples: '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) + 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Accepted suffixes are 'ms'/'mil(s)'/'millisecond(s)', 's'/'sec(s)'/'second(s)', 'm'/'min(s)'/'minute(s)', 'h'/'hour(s)', and 'd'/'day(s)', e.g. '500ms', '5400s', '90m', '1.5h', '1d'. "timeout" 选项应有一个字符串形式的参数,格式为 <value>[h|m|s],其中 "value" 为浮点型 A global test execution timeout. -Takes one argument as a time value with an explicit unit suffix. Accepted units are 'ms', 's', 'm', 'h', 'd' (long forms 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted), e.g. '500ms', '5400s', '90m', '1.5h', '1d'. +Takes one argument as a time value with an explicit unit suffix. Accepted suffixes are 'ms'/'mil(s)'/'millisecond(s)', 's'/'sec(s)'/'second(s)', 'm'/'min(s)'/'minute(s)', 'h'/'hour(s)', and 'd'/'day(s)', e.g. '500ms', '5400s', '90m', '1.5h', '1d'. 全局测试执行超时。 获取一个字符串形式的参数,格式为 <value>[h|m|s],其中 "value" 为浮点型。 diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.zh-Hant.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.zh-Hant.xlf index 0e0d1de320..3c1c7309e6 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.zh-Hant.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.zh-Hant.xlf @@ -674,13 +674,13 @@ The default is TestResults in the directory that contains the test application.< - 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Examples: '500ms', '5400s', '90m', '1.5h', '1d' (long forms like 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted) + 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Accepted suffixes are 'ms'/'mil(s)'/'millisecond(s)', 's'/'sec(s)'/'second(s)', 'm'/'min(s)'/'minute(s)', 'h'/'hour(s)', and 'd'/'day(s)', e.g. '500ms', '5400s', '90m', '1.5h', '1d'. 'timeout' 選項應該有一個引數作為字串,格式為 <value>[h|m|s],其中 'value' 為 float A global test execution timeout. -Takes one argument as a time value with an explicit unit suffix. Accepted units are 'ms', 's', 'm', 'h', 'd' (long forms 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted), e.g. '500ms', '5400s', '90m', '1.5h', '1d'. +Takes one argument as a time value with an explicit unit suffix. Accepted suffixes are 'ms'/'mil(s)'/'millisecond(s)', 's'/'sec(s)'/'second(s)', 'm'/'min(s)'/'minute(s)', 'h'/'hour(s)', and 'd'/'day(s)', e.g. '500ms', '5400s', '90m', '1.5h', '1d'. 全域測試執行逾時。 將一個引數作為字串,格式為 <value>[h|m|s],其中 'value' 為 float。 diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/HelpInfoTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/HelpInfoTests.cs index 61ac951b14..b713002d21 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/HelpInfoTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/HelpInfoTests.cs @@ -85,7 +85,7 @@ Determines when to show captured standard output of a test. Valid values are 'All', 'Failed', 'None'. Default is 'All'. --timeout A global test execution timeout. - Takes one argument as a time value with an explicit unit suffix. Accepted units are 'ms', 's', 'm', 'h', 'd' (long forms 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted), e.g. '500ms', '5400s', '90m', '1.5h', '1d'. + Takes one argument as a time value with an explicit unit suffix. Accepted suffixes are 'ms'/'mil(s)'/'millisecond(s)', 's'/'sec(s)'/'second(s)', 'm'/'min(s)'/'minute(s)', 'h'/'hour(s)', and 'd'/'day(s)', e.g. '500ms', '5400s', '90m', '1.5h', '1d'. Extension options: --filter Filters tests using the given expression. For more information, see the Filter option details section. For more information and examples on how to use selective unit test filtering, see https://learn.microsoft.com/dotnet/core/testing/selective-unit-tests. diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoAllExtensionsTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoAllExtensionsTests.cs index 3647d3b89e..a6569b4953 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoAllExtensionsTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoAllExtensionsTests.cs @@ -79,7 +79,7 @@ Determines when to show captured standard output of a test. Valid values are 'All', 'Failed', 'None'. Default is 'All'. --timeout A global test execution timeout. - Takes one argument as a time value with an explicit unit suffix. Accepted units are 'ms', 's', 'm', 'h', 'd' (long forms 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted), e.g. '500ms', '5400s', '90m', '1.5h', '1d'. + Takes one argument as a time value with an explicit unit suffix. Accepted suffixes are 'ms'/'mil(s)'/'millisecond(s)', 's'/'sec(s)'/'second(s)', 'm'/'min(s)'/'minute(s)', 'h'/'hour(s)', and 'd'/'day(s)', e.g. '500ms', '5400s', '90m', '1.5h', '1d'. Extension options: --crash-report [Linux/macOS only] Generate a JSON crash report when the test process crashes. Combine with '--crashdump' to also generate a dump file. Requires .NET 7+ when used alone; .NET 6+ when combined with '--crashdump'. This runtime requirement is not enforced by the tool: on unsupported runtimes no crash report will be emitted. Not supported on Windows due to a .NET runtime limitation (dotnet/runtime#80191). @@ -151,7 +151,7 @@ Enable generating TRX report --retry-failed-tests Retry failed tests the given number of times --retry-failed-tests-delay - Add a delay between retries. The delay is expressed as a time value, e.g. 200, 1s, 2.5m, 1h. Default unit is milliseconds. + Add a delay between retries. The delay is expressed as a time value, e.g. 200, 500ms, 1s, 2.5m, 1h, 1d. Default unit is milliseconds. --retry-failed-tests-max-percentage Disable retry mechanism if the percentage of failed tests is greater than the specified value --retry-failed-tests-max-tests @@ -308,7 +308,7 @@ Note that this is slowing down the test execution. Arity: 1 Hidden: False Description: A global test execution timeout. - Takes one argument as a time value with an explicit unit suffix. Accepted units are 'ms', 's', 'm', 'h', 'd' (long forms 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted), e.g. '500ms', '5400s', '90m', '1.5h', '1d'. + Takes one argument as a time value with an explicit unit suffix. Accepted suffixes are 'ms'/'mil(s)'/'millisecond(s)', 's'/'sec(s)'/'second(s)', 'm'/'min(s)'/'minute(s)', 'h'/'hour(s)', and 'd'/'day(s)', e.g. '500ms', '5400s', '90m', '1.5h', '1d'. TerminalTestReporterCommandLineOptionsProvider Name: Terminal test reporter Version: * diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoTests.cs index c63321f6af..9fc3ee4d23 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoTests.cs @@ -79,7 +79,7 @@ Determines when to show captured standard output of a test. Valid values are 'All', 'Failed', 'None'. Default is 'All'. --timeout A global test execution timeout. - Takes one argument as a time value with an explicit unit suffix. Accepted units are 'ms', 's', 'm', 'h', 'd' (long forms 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted), e.g. '500ms', '5400s', '90m', '1.5h', '1d'. + Takes one argument as a time value with an explicit unit suffix. Accepted suffixes are 'ms'/'mil(s)'/'millisecond(s)', 's'/'sec(s)'/'second(s)', 'm'/'min(s)'/'minute(s)', 'h'/'hour(s)', and 'd'/'day(s)', e.g. '500ms', '5400s', '90m', '1.5h', '1d'. Extension options: No extension registered. """; @@ -257,7 +257,7 @@ Note that this is slowing down the test execution\. Arity: 1 Hidden: False Description: A global test execution timeout. - Takes one argument as a time value with an explicit unit suffix\. Accepted units are 'ms', 's', 'm', 'h', 'd' \(long forms 'milliseconds', 'seconds', 'minutes', 'hours', 'days' are also accepted\), e\.g\. '500ms', '5400s', '90m', '1\.5h', '1d'\. + Takes one argument as a time value with an explicit unit suffix\. Accepted suffixes are 'ms'/'mil\(s\)'/'millisecond\(s\)', 's'/'sec\(s\)'/'second\(s\)', 'm'/'min\(s\)'/'minute\(s\)', 'h'/'hour\(s\)', and 'd'/'day\(s\)', e\.g\. '500ms', '5400s', '90m', '1\.5h', '1d'\. TerminalTestReporterCommandLineOptionsProvider Name: Terminal test reporter Version: .+ diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TimeoutTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TimeoutTests.cs index de6e537c5f..92b76714fa 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TimeoutTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TimeoutTests.cs @@ -110,6 +110,19 @@ public async Task TimeoutWithValidArg_WithLongFormSuffix_WithTestTimeOut_OutputC testHostResult.AssertOutputContains("Canceling the test session"); } + [DynamicData(nameof(TargetFrameworks.AllForDynamicData), typeof(TargetFrameworks))] + [TestMethod] + public async Task TimeoutWithValidArg_WithAliasSuffix_WithTestTimeOut_OutputContainsCancelingMessage(string tfm) + { + // 'mil' is one of the alias suffixes documented in the --timeout help text. This test makes + // sure such aliases work through the full --timeout option path (not just the shared parser). + var testHost = TestInfrastructure.TestHost.LocateFrom(AssetFixture.NoExtensionTargetAssetPath, TestAssetFixture.AssetName, tfm); + TestHostResult testHostResult = await testHost.ExecuteAsync("--timeout 500mil", cancellationToken: TestContext.CancellationToken); + + testHostResult.AssertExitCodeIsNot(ExitCode.Success); + testHostResult.AssertOutputContains("Canceling the test session"); + } + [DynamicData(nameof(TargetFrameworks.AllForDynamicData), typeof(TargetFrameworks))] [TestMethod] public async Task TimeoutWithValidArg_WithSecondAsSuffix_WithTestNotTimeOut_OutputDoesNotContainCancelingMessage(string tfm) From 6dbc33f86697f4fad9644eaca541999ba48af429 Mon Sep 17 00:00:00 2001 From: Evangelink <11340282+Evangelink@users.noreply.github.com> Date: Tue, 26 May 2026 10:30:23 +0200 Subject: [PATCH 6/6] Fix botched merge in pt-BR / zh-Hant XLF files The merge between this branch (which updated PlatformCommandLineTimeoutArgumentErrorMessage to a new longer English source) and origin/main (which had a OneLocBuild update translating the previous shorter source for pt-BR and zh-Hant) was resolved by stacking both / pairs inside a single . This left those two files structurally invalid (duplicate and children, effectively a missing ) and inconsistent with all other languages. Remove the stale OneLocBuild / pair (which was for the old English source) so each has a single + matching the structure of the other localized files. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Resources/xlf/PlatformResources.pt-BR.xlf | 2 -- .../Resources/xlf/PlatformResources.zh-Hant.xlf | 2 -- 2 files changed, 4 deletions(-) diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.pt-BR.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.pt-BR.xlf index 0ab5b9db4f..370ed8a1be 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.pt-BR.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.pt-BR.xlf @@ -676,8 +676,6 @@ O padrão é TestResults no diretório que contém o aplicativo de teste. 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Accepted suffixes are 'ms'/'mil(s)'/'millisecond(s)', 's'/'sec(s)'/'second(s)', 'm'/'min(s)'/'minute(s)', 'h'/'hour(s)', and 'd'/'day(s)', e.g. '500ms', '5400s', '90m', '1.5h', '1d'. A opção 'timeout' deve ter um argumento como cadeia de caracteres no formato <value>[h|m|s] onde 'value' é float - 'timeout' option should have one argument as string in the format <value>[h|m|s] where 'value' is a finite, non-negative number that does not exceed the maximum supported duration - A opção 'timeout' deve ter um argumento como cadeia de caracteres no formato <value>[h|m|s], em que ''value'' é um número finito e não negativo que não excede a duração máxima com suporte diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.zh-Hant.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.zh-Hant.xlf index 23f7754cb9..3c1c7309e6 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.zh-Hant.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.zh-Hant.xlf @@ -676,8 +676,6 @@ The default is TestResults in the directory that contains the test application.< 'timeout' option should have one argument as a time value with an explicit unit suffix and a positive numeric value within the supported range (up to ~49.7 days). Accepted suffixes are 'ms'/'mil(s)'/'millisecond(s)', 's'/'sec(s)'/'second(s)', 'm'/'min(s)'/'minute(s)', 'h'/'hour(s)', and 'd'/'day(s)', e.g. '500ms', '5400s', '90m', '1.5h', '1d'. 'timeout' 選項應該有一個引數作為字串,格式為 <value>[h|m|s],其中 'value' 為 float - 'timeout' option should have one argument as string in the format <value>[h|m|s] where 'value' is a finite, non-negative number that does not exceed the maximum supported duration - 'timeout' 選項應包含一個字串引數,格式為 <value>[h|m|s],其中 'value' 必須是有限的非負數,且不得超過支援的最大持續時間