Skip to content

Commit 28585cc

Browse files
Remove module installation time from expected log entry (#883)
1 parent 5b2eaf5 commit 28585cc

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

test/Unit/DependencyManagement/DependencyManagementTests.cs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@
1111

1212
namespace Microsoft.Azure.Functions.PowerShellWorker.Test
1313
{
14-
using System.Diagnostics;
1514
using System.Linq;
1615
using System.Management.Automation;
17-
using System.Threading;
1816

1917
public class DependencyManagementTests : IDisposable
2018
{
@@ -483,12 +481,12 @@ public void SaveModule(PowerShell pwsh, string moduleName, string version, strin
483481
{
484482
if (SuccessfulDownload || (SaveModuleCount >= ShouldNotThrowAfterCount))
485483
{
486-
var stopwatch = new Stopwatch();
487-
stopwatch.Start();
488-
Thread.Sleep(10); // wait for 10 milliseconds
484+
// Save the module name and version with a duration of 10 milliseconds for a successful download.
485+
var expectedString = string.Format(PowerShellWorkerStrings.ModuleHasBeenInstalled, moduleName, version, 10);
486+
487+
// Remove the time in milliseconds given that this will be different depending on the machine where the test is executed.
488+
DownloadedModuleInfo = expectedString.Substring(0, expectedString.IndexOf("10"));
489489

490-
// Save the module name and version for a successful download.
491-
DownloadedModuleInfo = string.Format(PowerShellWorkerStrings.ModuleHasBeenInstalled, moduleName, version, stopwatch.ElapsedMilliseconds);
492490
return;
493491
}
494492

0 commit comments

Comments
 (0)