Skip to content

Commit 7b6d835

Browse files
javiercnHaoK
authored andcommitted
Skip tracking logic in helix
1 parent cae1a72 commit 7b6d835

File tree

2 files changed

+33
-26
lines changed

2 files changed

+33
-26
lines changed

src/Components/Web.JS/dist/Release/blazor.server.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Shared/E2ETesting/SeleniumStandaloneServer.cs

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -110,36 +110,43 @@ private static async Task InitializeInstance(ITestOutputHelper output)
110110
psi.Arguments = $"/c npm {psi.Arguments}";
111111
}
112112

113-
// It's important that we get the folder value before we start the process to prevent
114-
// untracked processes when the tracking folder is not correctly configure.
115-
var trackingFolder = GetProcessTrackingFolder();
116-
117-
if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix")))
118-
{
119-
// Just create a random tracking folder on helix
120-
trackingFolder = Path.Combine(Directory.GetCurrentDirectory(), Path.GetRandomFileName());
121-
Directory.CreateDirectory(trackingFolder);
122-
}
123-
124-
if (!Directory.Exists(trackingFolder))
125-
{
126-
throw new InvalidOperationException($"Invalid tracking folder. Set the 'SeleniumProcessTrackingFolder' MSBuild property to a valid folder.");
127-
}
128-
129113
Process process = null;
130114
Process sentinel = null;
131115
string pidFilePath = null;
132-
try
116+
if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix")))
133117
{
134-
process = Process.Start(psi);
135-
pidFilePath = await WriteTrackingFileAsync(output, trackingFolder, process);
136-
sentinel = StartSentinelProcess(process, pidFilePath, SeleniumProcessTimeout);
118+
// It's important that we get the folder value before we start the process to prevent
119+
// untracked processes when the tracking folder is not correctly configure.
120+
var trackingFolder = GetProcessTrackingFolder();
121+
122+
if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix")))
123+
{
124+
// Just create a random tracking folder on helix
125+
trackingFolder = Path.Combine(Directory.GetCurrentDirectory(), Path.GetRandomFileName());
126+
Directory.CreateDirectory(trackingFolder);
127+
}
128+
129+
if (!Directory.Exists(trackingFolder))
130+
{
131+
throw new InvalidOperationException($"Invalid tracking folder. Set the 'SeleniumProcessTrackingFolder' MSBuild property to a valid folder.");
132+
}
133+
134+
try
135+
{
136+
process = Process.Start(psi);
137+
pidFilePath = await WriteTrackingFileAsync(output, trackingFolder, process);
138+
sentinel = StartSentinelProcess(process, pidFilePath, SeleniumProcessTimeout);
139+
}
140+
catch
141+
{
142+
ProcessCleanup(process, pidFilePath);
143+
ProcessCleanup(sentinel, pidFilePath: null);
144+
throw;
145+
}
137146
}
138-
catch
147+
else
139148
{
140-
ProcessCleanup(process, pidFilePath);
141-
ProcessCleanup(sentinel, pidFilePath: null);
142-
throw;
149+
process = Process.Start(psi);
143150
}
144151

145152
// Log output for selenium standalone process.

0 commit comments

Comments
 (0)