Skip to content
New issue

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

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

Already on GitHub? # to your account

[debugger] Throw with short and easily caught message in debugger tests. #109011

Merged
merged 5 commits into from
Oct 18, 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
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,23 @@ internal virtual JObject CreateEvaluateArgs(string expression)

internal virtual async Task<JObject> WaitFor(string what)
{
return await insp.WaitFor(what);
try
{
var timeout = Task.Delay(10000);
var waitForTask = insp.WaitFor(what);
var completedTask = await Task.WhenAny(waitForTask, timeout);
if (completedTask == timeout)
{
throw new TimeoutException($"Debugger inspector waiting for {what} timed out after 10 seconds");
}
return await waitForTask;
}
catch
{
throw new Exception($"Debugger inspector waiting for {what} failed");
}
}

public async Task WaitForConsoleMessage(string message)
{
object llock = new();
Expand Down
Loading