Skip to content

Commit

Permalink
Shorten timeout for finding Apple devices (#683)
Browse files Browse the repository at this point in the history
Co-authored-by: Katya Sokolova <[email protected]>
  • Loading branch information
premun and Katya Sokolova authored Jul 27, 2021
1 parent 930d33d commit be39724
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/Microsoft.DotNet.XHarness.iOS.Shared/Execution/Arguments.cs
Original file line number Diff line number Diff line change
Expand Up @@ -415,4 +415,14 @@ public TcpTunnelArgument(int port)

public override string AsCommandLineArgument() => $"--tcp-tunnel={_port}:{_port}";
}

/// <summary>
/// Specify a timeout (in seconds) for the commands that doesn't have fixed duration.
/// </summary>
public sealed class TimeoutArgument : SingleValueArgument
{
public TimeoutArgument(double timeoutInSeconds) : base("timeout", timeoutInSeconds.ToString())
{
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ public async Task LoadDevices(ILog log, bool includeLocked = false, bool forceRe
var arguments = new MlaunchArguments(
new ListDevicesArgument(tmpfile),
new ListWirelessDevicesArgument(includeWirelessDevices),
new XmlOutputFormatArgument());
new XmlOutputFormatArgument(),
new TimeoutArgument(0.5));

if (listExtraData)
{
Expand Down

0 comments on commit be39724

Please sign in to comment.