Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/Utilities.UnitTests/ToolTask_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ protected override string GenerateCommandLineCommands()
/// predefined amount of time. The first execution may time out, but all following ones won't. It is expected
/// that all following executions return success.
/// </remarks>
[Theory(Skip = "https://github.com/dotnet/msbuild/issues/8750")]
[Theory]
[InlineData(1, 1, 1, -1)] // Normal case, no repeat.
[InlineData(3, 1, 1, -1)] // Repeat without timeout.
[InlineData(3, 10000, 1, 1000)] // Repeat with timeout.
Expand Down Expand Up @@ -886,8 +886,8 @@ public void ToolTaskThatTimeoutAndRetry(int repeats, int initialDelay, int follo
/// </remarks>
private sealed class ToolTaskThatSleeps : ToolTask
{
// PowerShell command to sleep:
private readonly string _powerShellSleep = "-NoProfile -ExecutionPolicy RemoteSigned -Command \"Start-Sleep -Milliseconds {0}\"";
// Windows prompt command to sleep:
private readonly string _windowsSleep = "/c start /wait timeout {0}";

// UNIX command to sleep:
private readonly string _unixSleep = "-c \"sleep {0}\"";
Expand All @@ -898,8 +898,8 @@ private sealed class ToolTaskThatSleeps : ToolTask
public ToolTaskThatSleeps()
: base()
{
// Determines shell to use: PowerShell for Windows, sh for UNIX-like systems:
_pathToShell = NativeMethodsShared.IsUnixLike ? "/bin/sh" : FindOnPath("PowerShell.exe");
// Determines shell to use: cmd for Windows, sh for UNIX-like systems:
_pathToShell = NativeMethodsShared.IsUnixLike ? "/bin/sh" : "cmd.exe";
}

/// <summary>
Expand Down Expand Up @@ -940,7 +940,7 @@ public ToolTaskThatSleeps()
protected override string GenerateCommandLineCommands() =>
NativeMethodsShared.IsUnixLike ?
string.Format(_unixSleep, RepeatCount < 2 ? InitialDelay / 1000.0 : FollowupDelay / 1000.0) :
string.Format(_powerShellSleep, RepeatCount < 2 ? InitialDelay : FollowupDelay);
string.Format(_windowsSleep, RepeatCount < 2 ? InitialDelay / 1000.0 : FollowupDelay / 1000.0);

/// <summary>
/// Ensures that test parameters make sense.
Expand Down