Skip to content

Commit f84d33c

Browse files
authored
Skip EventSource tests if process is not elevated (#99261)
1 parent b020042 commit f84d33c

File tree

1 file changed

+2
-1
lines changed
  • src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/Harness

1 file changed

+2
-1
lines changed

src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/Harness/EtwListener.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
using Microsoft.Diagnostics.Tracing;
55
using Microsoft.Diagnostics.Tracing.Session;
6+
using Microsoft.DotNet.XUnitExtensions;
67
using System;
78
using System.Collections.Generic;
89
using System.Diagnostics;
@@ -39,7 +40,7 @@ public EtwListener(string dataFileName = "EventSourceTestData.etl", string sessi
3940
// Today you have to be Admin to turn on ETW events (anyone can write ETW events).
4041
if (TraceEventSession.IsElevated() != true)
4142
{
42-
throw new Exception("Need to be elevated to run. ");
43+
throw new SkipTestException("Need to be elevated to run. ");
4344
}
4445

4546
if (dataFileName == null)

0 commit comments

Comments
 (0)