Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[debugger] Opening the inspector session can fail with other exceptions than cancellation #109063

Merged
merged 3 commits into from
Oct 21, 2024
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
21 changes: 14 additions & 7 deletions src/mono/browser/debugger/DebuggerTestSuite/DebuggerTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,17 +184,24 @@ public virtual async Task InitializeAsync()
try {
await insp.OpenSessionAsync(fn, $"http://{TestHarnessProxy.Endpoint.Authority}/{driver}", TestTimeout);
}
catch (TaskCanceledException exc) //if timed out for some reason let's try again
catch (Exception exc) //if failed some reason let's try again
{
if (!retry)
throw exc;
throw new Exception($"Debugger inspector session opening failed and will not be retried: {exc}");
retry = false;
_testOutput.WriteLine($"Let's retry: {exc.ToString()}");
Id = Interlocked.Increment(ref s_idCounter);
insp = new Inspector(Id, _testOutput);
cli = insp.Client;
scripts = SubscribeToScripts(insp);
await insp.OpenSessionAsync(fn, $"http://{TestHarnessProxy.Endpoint.Authority}/{driver}", TestTimeout);
try
{
Id = Interlocked.Increment(ref s_idCounter);
insp = new Inspector(Id, _testOutput);
cli = insp.Client;
scripts = SubscribeToScripts(insp);
await insp.OpenSessionAsync(fn, $"http://{TestHarnessProxy.Endpoint.Authority}/{driver}", TestTimeout);
}
catch (Exception secondEx)
{
throw new Exception($"Debugger inspector session opening failed: {secondEx}");
}
}
}

Expand Down
Loading