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

Fix ReliabilityFramework code formatting #56342

Merged
merged 1 commit into from
Jul 27, 2021
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/tests/GC/Stress/Framework/DetourHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void SetTestIdName(int id, string name)
}

[DllImport("RFDetours")]
private static extern void AddTestToNameMapping(int id, [MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPStr)]string name);
private static extern void AddTestToNameMapping(int id, [MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPStr)] string name);

[DllImport("RFDetours")]
private static extern void InstallDetours();
Expand Down
20 changes: 10 additions & 10 deletions src/tests/GC/Stress/Framework/RFLogging.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ private void LogWorker()
while (true)
{
bool cachedCloseLogFile = _closeLogFile; // The CloseLog method will set closeLogFile to true indicating we should close the log file
// This value is cached here so we can write all of the remaining messages to log before closing it
// This value is cached here so we can write all of the remaining messages to log before closing it
int messageQueueCount = _messageQueue.Count;
int instrumentationQueueCount = _instrumentationMessageQueue.Count;

Expand Down Expand Up @@ -141,15 +141,15 @@ private void CreateInstrumentationLog()
{
try
{
string logFilename = Path.Combine (logDirectory, "instrmentation.log");
string logFilename = Path.Combine(logDirectory, "instrmentation.log");
while (File.Exists(logFilename))
{
logFilename = Path.Combine (logDirectory, "instrmentation.log-" + DateTime.Now.ToString().Replace('/', '-').Replace(':', '.'));
logFilename = Path.Combine(logDirectory, "instrmentation.log-" + DateTime.Now.ToString().Replace('/', '-').Replace(':', '.'));
}

string logDirname = Path.GetDirectoryName (logFilename);
if (!Directory.Exists (logDirname))
Directory.CreateDirectory (logDirname);
string logDirname = Path.GetDirectoryName(logFilename);
if (!Directory.Exists(logDirname))
Directory.CreateDirectory(logDirname);
_instrumentationLogFile = File.Open(logFilename, FileMode.CreateNew, FileAccess.ReadWrite, FileShare.ReadWrite);
}
catch
Expand Down Expand Up @@ -186,17 +186,17 @@ public void OpenLog(string name)
{
fRetry = false;

string safeName = Path.Combine (logDirectory, name.Replace('\\', ' ').Replace('*', ' ').Replace('?', ' ').Replace('>', ' ').Replace('<', ' ').Replace('|', ' ').Replace(':', ' ').Replace('/', ' ').Replace('"', ' '));
string safeName = Path.Combine(logDirectory, name.Replace('\\', ' ').Replace('*', ' ').Replace('?', ' ').Replace('>', ' ').Replace('<', ' ').Replace('|', ' ').Replace(':', ' ').Replace('/', ' ').Replace('"', ' '));
filename = safeName + ".log";
if (File.Exists(filename))
{
filename = String.Format("{0} - {1}.log", safeName, DateTime.Now.ToString().Replace('/', '-').Replace(':', '.'));
}
try
{
string dirname = Path.GetDirectoryName (filename);
if (!Directory.Exists (dirname))
Directory.CreateDirectory (dirname);
string dirname = Path.GetDirectoryName(filename);
if (!Directory.Exists(dirname))
Directory.CreateDirectory(dirname);
_logFile = File.Open(filename, FileMode.CreateNew, FileAccess.ReadWrite, FileShare.ReadWrite);
}
catch (IOException e)
Expand Down
6 changes: 3 additions & 3 deletions src/tests/GC/Stress/Framework/ReliabilityConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ private void GetTestsToRun(string testConfig)
_curTestSet.MaximumTime = 10;
}

while (currentXML.MoveToNextAttribute())
while (currentXML.MoveToNextAttribute())
{
XmlDebugOut(" " + currentXML.Name + "=\"" + currentXML.Value + "\"");
switch (currentXML.Name)
Expand Down Expand Up @@ -456,7 +456,7 @@ private void GetTestsToRun(string testConfig)
cpuCount = Convert.ToInt32(Environment.GetEnvironmentVariable("NUMBER_OF_PROCESSORS"));
}

if (cpuCount <= 0)
if (cpuCount <= 0)
throw new Exception("Invalid Value when reading processor count: " + cpuCount);
_curTestSet.MinTestsRunning = cpuCount;
_curTestSet.MaxTestsRunning = (int)(cpuCount * 1.5);
Expand Down Expand Up @@ -962,7 +962,7 @@ private void GetTestsToRun(string testConfig)
}

int testCopies = 1;
if (_curTestSet.AppDomainLoaderMode == AppDomainLoaderMode.FullIsolation ||
if (_curTestSet.AppDomainLoaderMode == AppDomainLoaderMode.FullIsolation ||
_curTestSet.AssemblyLoadContextLoaderMode == AssemblyLoadContextLoaderMode.FullIsolation)
{
// in this mode each copy of the test is ran in it's own app domain or AssemblyLoadContext,
Expand Down
14 changes: 7 additions & 7 deletions src/tests/GC/Stress/Framework/ReliabilityFramework.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public class ReliabilityFramework
#endif
{
// instance members
private int _testsRunningCount = 0,_testsRanCount = 0,_failCount = 0;
private int _testsRunningCount = 0, _testsRanCount = 0, _failCount = 0;
private ReliabilityConfig _reliabilityConfig;
private ReliabilityTestSet _curTestSet;
private DateTime _startTime;
Expand All @@ -127,7 +127,7 @@ public class ReliabilityFramework
#if !PROJECTK_BUILD
AppDomain[] _testDomains = null;
#endif
TestAssemblyLoadContext[] _testALCs = null;
TestAssemblyLoadContext[] _testALCs = null;
private DetourHelpers _detourHelpers;
private Hashtable _foundTests;
public int LoadingCount = 0;
Expand Down Expand Up @@ -160,7 +160,7 @@ public static int Main(string[] args)
{
string configFile = null;
bool okToContinue = true, doReplay = false;
string sTests = "tests", sSeed = "seed",exectime ="maximumExecutionTime";
string sTests = "tests", sSeed = "seed", exectime = "maximumExecutionTime";

ReliabilityFramework rf = new ReliabilityFramework();
rf._logger.WriteToInstrumentationLog(null, LoggingLevels.StartupShutdown, "Started");
Expand Down Expand Up @@ -213,8 +213,8 @@ public static int Main(string[] args)
// if no config file specified, check for [something]_gc.config in the current folder.
if (configFile == null)
{
var config = IsRunningAsUnitTest ?
"*_gc_ci.config" :
var config = IsRunningAsUnitTest ?
"*_gc_ci.config" :
"*_gc.config";

configFile = Directory.GetFiles(Environment.CurrentDirectory, config).SingleOrDefault();
Expand Down Expand Up @@ -1856,11 +1856,11 @@ void TestPreLoader_AssemblyLoadContext(ReliabilityTest test, string[] paths)

if (test.Assembly.ToLower().IndexOf(".exe") == -1 && test.Assembly.ToLower().IndexOf(".dll") == -1) // must be a simple name or fullname...
{
loadMethod.Invoke(obj, new object[] { test.Assembly, paths});
loadMethod.Invoke(obj, new object[] { test.Assembly, paths });
}
else // has an executable extension, must be in local directory.
{
loadFromMethod.Invoke(obj, new object[] { Path.Combine(test.BasePath, test.Assembly), paths});
loadFromMethod.Invoke(obj, new object[] { Path.Combine(test.BasePath, test.Assembly), paths });
}

// check and see if this test is marked as requiring STA. We only do
Expand Down
10 changes: 5 additions & 5 deletions src/tests/GC/Stress/Framework/ReliabilityTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public class ReliabilityTest
{
private bool _suppressConsoleOutput = false;

private string _assembly,_debugger,_debuggerOptions;
private string _assembly, _debugger, _debuggerOptions;
private string _basePath;
#if PROJECTK_BUILD
private MethodInfo _entryPointMethod = null;
Expand All @@ -117,7 +117,7 @@ public class ReliabilityTest
private int _concurrentCopies = 1;
private int _runningCount = 0;
private int _expectedDuration = -1;
private bool _requiresSDK = false,_hasFailed = false;
private bool _requiresSDK = false, _hasFailed = false;
private Guid _guid = Guid.Empty;
private TestStartModeEnum _testStartMode = TestStartModeEnum.AppDomainLoader;
private DateTime _startTime = DateTime.Now;
Expand Down Expand Up @@ -272,7 +272,7 @@ public TestAssemblyLoadContext AssemblyLoadContext
public bool HasAssemblyLoadContext
{
[MethodImpl(MethodImplOptions.NoInlining)]
get { return _assemblyLoadContext != null; }
get { return _assemblyLoadContext != null; }
}

public string AssemblyLoadContextName
Expand Down Expand Up @@ -436,7 +436,7 @@ public string Debugger
// first, check the current directory
string curDir = Directory.GetCurrentDirectory();
string theAnswer;
if (File.Exists(theAnswer = Path.Combine (curDir, _debugger)))
if (File.Exists(theAnswer = Path.Combine(curDir, _debugger)))
{
return (theAnswer);
}
Expand All @@ -451,7 +451,7 @@ public string Debugger
string[] splitPath = path.Split(new char[] { ';' });
foreach (string curPath in splitPath)
{
if (File.Exists(theAnswer = Path.Combine (curPath, _debugger)))
if (File.Exists(theAnswer = Path.Combine(curPath, _debugger)))
{
return (theAnswer);
}
Expand Down
8 changes: 4 additions & 4 deletions src/tests/GC/Stress/Framework/ReliabilityTestSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@ public class ReliabilityTestSet
private int _percentPassIsPass = System.Environment.GetEnvironmentVariable("PERCENTPASSISPASS") == null ? -1 : Convert.ToInt32(System.Environment.GetEnvironmentVariable("PERCENTPASSISPASS"));
private int[] _minPercentCPUStaggered_times = null;
private int[] _minPercentCPUStaggered_usage = null;
private int _minimumCPUpercent = 0,_minimumMemoryPercent = 0,_minimumTestsRunning = 0,_maximumTestsRunning = -1; // minimum CPU & memory requirements.
private int _minimumCPUpercent = 0, _minimumMemoryPercent = 0, _minimumTestsRunning = 0, _maximumTestsRunning = -1; // minimum CPU & memory requirements.
private ReliabilityTest[] _tests;
private string[] _discoveryPaths = null;
private string _friendlyName;
private bool _enablePerfCounters = true,_disableLogging = false,_installDetours = false;
private bool _enablePerfCounters = true, _disableLogging = false, _installDetours = false;
private bool _suppressConsoleOutputFromTests = false;
private bool _debugBreakOnTestHang = true;
private bool _debugBreakOnBadTest = false;
private bool _debugBreakOnOutOfMemory = false;
private bool _debugBreakOnPathTooLong = false;
private bool _debugBreakOnMissingTest = false;
private TestStartModeEnum _testStartMode = TestStartModeEnum.AppDomainLoader;
private string _defaultDebugger,_defaultDebuggerOptions;
private int _ulGeneralUnloadPercent = 0,_ulAppDomainUnloadPercent = 0,_ulAssemblyLoadPercent = 0,_ulWaitTime = 0;
private string _defaultDebugger, _defaultDebuggerOptions;
private int _ulGeneralUnloadPercent = 0, _ulAppDomainUnloadPercent = 0, _ulAssemblyLoadPercent = 0, _ulWaitTime = 0;
private bool _reportResults = false;
private string _reportResultsTo = "http://clrqa/SmartAPI/result.asmx";
private Guid _bvtCategory = Guid.Empty;
Expand Down