Skip to content

Conversation

@VincentBu
Copy link
Contributor

This pull request aims at:

  1. Removing all kernel32.dll references
  2. Replacing all debug breakpoints with logging
  3. Setting debugBreakOnTestHang to false for all configurations

@ghost ghost added the area-GC-coreclr label Oct 8, 2024
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Oct 8, 2024
@VincentBu VincentBu requested a review from mrsharm October 8, 2024 07:46
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @dotnet/gc
See info in area-owners.md if you want to be subscribed.

@Maoni0
Copy link
Member

Maoni0 commented Oct 8, 2024

is the test hang just an artifact of the reporting, ie, if a test runs for a long time RF considers it hung? and is this only during the last phase where RF is trying to exit?

@VincentBu
Copy link
Contributor Author

is the test hang just an artifact of the reporting, ie, if a test runs for a long time RF considers it hung? and is this only during the last phase where RF is trying to exit?

Yes. If there are tests uncompleted after the time limit reached, TestIsHungDebugBreak is called. It will block the thread for further actions (for example, attaching the process with a debugger).
Moko and Andrew suggest me to collect dumps directly then we can analyze them with windbg. This facilitates our work when running tests on Linux.

}
catch (IOException e)
{
ReliabilityFramework.MyDebugBreak(String.Format("LogWorker IOException:{0}", e.ToString()));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's throw the exception here so that we can take a dump

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the debugger break is set to true, we should set a debug break point here and if not, log and throw an exception.

minMaxTestUseCPUCount="true"
suppressConsoleOutputFromTests="true"
debugBreakOnTestHang="true">
debugBreakOnTestHang="false">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove as the default is false. (Same for the other configurations)

if (_curTestSet.DebugBreakOnTestHang)
{
TestIsHungDebugBreak();
Console.WriteLine("Test hang.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be via the logger and so should be the case below.

}
catch (IOException e)
{
ReliabilityFramework.MyDebugBreak(String.Format("LogWorker IOException:{0}", e.ToString()));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably want to throw an exception here still after logging?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above: if debugger is present => break else, log and throw an exception.

{
// hang and let someone debug if we can't even break in...
Thread.CurrentThread.Join();
_logger.WriteToInstrumentationLog(_curTestSet, LoggingLevels.Tests, "Out of memory");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we throw here to pick up the dump on the scripts?

{
// hang and let someone debug if we can't even break in...
Thread.CurrentThread.Join();
_logger.WriteToInstrumentationLog(_curTestSet, LoggingLevels.Tests, "Out of memory");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same logic here - if debugger present => break.

if (_curTestSet.DebugBreakOnMissingTest && DateTime.Now.Subtract(_startTime) > minTimeToStartTest)
{
NewTestsNotStartingDebugBreak();
_logger.WriteToInstrumentationLog(_curTestSet, LoggingLevels.TestStarter, String.Format("New tests not starting"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add debug break conditional functionality.

{
ReliabilityFramework.MyDebugBreak(String.Format("LogWorker IOException:{0}", e.ToString()));
//Disk may be full so simply stop logging
if (ReliabilityFramework._debugBreakOnTestHang)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe moving this to it's own method parameterized with its own method e.g., void DebugBreakOrThrowException(string message).

bool Run(); // returns true on success, false on failure.
}

public class MissingTestException : Exception
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we mark this as a sealed class?

Copy link
Member

@mrsharm mrsharm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cshung cshung merged commit 302e0d4 into dotnet:main Nov 5, 2024
70 checks passed
@VincentBu VincentBu deleted the RemoveAllDebugBreakReference branch November 6, 2024 05:14
@github-actions github-actions bot locked and limited conversation to collaborators Dec 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-GC-coreclr community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants