From c5f2b4054fad1aa7a8bb821737584c31c851cd23 Mon Sep 17 00:00:00 2001 From: Praburaj Date: Sun, 8 Jun 2014 12:06:37 -0700 Subject: [PATCH] Fixing a test bug resulting in a null reference After starting the klr.exe process, Process.MainModule.FileName returns null if checked soon. Adding a thread sleep to solve this issue. --- test/E2ETests/DeploymentUtility.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/E2ETests/DeploymentUtility.cs b/test/E2ETests/DeploymentUtility.cs index ec534a8c12..f030c35a1d 100644 --- a/test/E2ETests/DeploymentUtility.cs +++ b/test/E2ETests/DeploymentUtility.cs @@ -88,6 +88,8 @@ namespace E2ETests }; var hostProcess = Process.Start(startInfo); + //Sometimes reading MainModule returns null if called immediately after starting process. + Thread.Sleep(1 * 1000); Console.WriteLine("Started {0}. Process Id : {1}", hostProcess.MainModule.FileName, hostProcess.Id); WaitTillDbCreated(identityDbName);