finally
{
EventLog.DeleteEventSource(source);
- Helpers.Retry(() => EventLog.Delete(log));
+ Helpers.RetrySilently(() => EventLog.Delete(log));
}
}
finally
{
EventLog.DeleteEventSource(source);
- Helpers.Retry(() => EventLog.Delete(log));
+ Helpers.RetrySilently(() => EventLog.Delete(log));
}
}
finally
{
EventLog.DeleteEventSource(source);
- Helpers.Retry(() => EventLog.Delete(log));
+ Helpers.RetrySilently(() => EventLog.Delete(log));
}
}
finally
{
EventLog.DeleteEventSource(source);
- Helpers.Retry(() => EventLog.Delete(log));
+ Helpers.RetrySilently(() => EventLog.Delete(log));
}
}
}
finally
{
EventLog.DeleteEventSource(source);
- Helpers.Retry(() => EventLog.Delete(log));
+ Helpers.Retry(() => EventLog.Delete(log)); // unlike other tests, throw if delete fails
}
Assert.False(EventLog.SourceExists(source));
finally
{
EventLog.DeleteEventSource(source);
- Helpers.Retry(() => EventLog.Delete(log));
+ Helpers.RetrySilently(() => EventLog.Delete(log));
}
}
finally
{
EventLog.DeleteEventSource(source);
- Helpers.Retry(() => EventLog.Delete(log));
+ Helpers.RetrySilently(() => EventLog.Delete(log));
}
}
finally
{
EventLog.DeleteEventSource(source);
- Helpers.Retry(() => EventLog.Delete(log));
+ Helpers.Retry(() => EventLog.Delete(log)); // unlike other tests, throw if delete fails
Assert.False(EventLog.Exists(log));
}
}
finally
{
EventLog.DeleteEventSource(source);
- Helpers.Retry(() => EventLog.Delete(log));
+ Helpers.RetrySilently(() => EventLog.Delete(log));
}
}
finally
{
EventLog.DeleteEventSource(source);
- Helpers.Retry(() => EventLog.Delete(log));
+ Helpers.RetrySilently(() => EventLog.Delete(log));
}
}
finally
{
EventLog.DeleteEventSource(source);
- Helpers.Retry(() => EventLog.Delete(log));
+ Helpers.RetrySilently(() => EventLog.Delete(log));
}
}
finally
{
EventLog.DeleteEventSource(source);
- Helpers.Retry(() => EventLog.Delete(log));
+ Helpers.RetrySilently(() => EventLog.Delete(log));
}
}
finally
{
EventLog.DeleteEventSource(source);
- Helpers.Retry(() => EventLog.Delete(log));
+ Helpers.RetrySilently(() => EventLog.Delete(log));
}
}
finally
{
EventLog.DeleteEventSource(source);
- Helpers.Retry(() => EventLog.Delete(log));
+ Helpers.RetrySilently(() => EventLog.Delete(log));
}
}
finally
{
EventLog.DeleteEventSource(source);
- Helpers.Retry(() => EventLog.Delete(log));
+ Helpers.RetrySilently(() => EventLog.Delete(log));
}
}
finally
{
EventLog.DeleteEventSource(source);
- Helpers.Retry(() => EventLog.Delete(log));
+ Helpers.RetrySilently(() => EventLog.Delete(log));
}
}
finally
{
EventLog.DeleteEventSource(source);
- Helpers.Retry(() => EventLog.Delete(log));
+ Helpers.RetrySilently(() => EventLog.Delete(log));
}
}
finally
{
EventLog.DeleteEventSource(source);
- Helpers.Retry(() => EventLog.Delete(log));
+ Helpers.RetrySilently(() => EventLog.Delete(log));
}
}
finally
{
EventLog.DeleteEventSource(source);
- Helpers.Retry(() => EventLog.Delete(log));
+ Helpers.RetrySilently(() => EventLog.Delete(log));
}
}
finally
{
EventLog.DeleteEventSource(source);
- Helpers.Retry(() => EventLog.Delete(log));
+ Helpers.RetrySilently(() => EventLog.Delete(log));
}
}
finally
{
EventLog.DeleteEventSource(source);
- Helpers.Retry(() => EventLog.Delete(log));
+ Helpers.RetrySilently(() => EventLog.Delete(log));
}
}
finally
{
EventLog.DeleteEventSource(source);
- Helpers.Retry(() => EventLog.Delete(log));
+ Helpers.RetrySilently(() => EventLog.Delete(log));
}
}
finally
{
EventLog.DeleteEventSource(source);
- Helpers.Retry(() => EventLog.Delete(log));
+ Helpers.RetrySilently(() => EventLog.Delete(log));
}
}
finally
{
EventLog.DeleteEventSource(source);
- Helpers.Retry(() => EventLog.Delete(log));
+ Helpers.RetrySilently(() => EventLog.Delete(log));
}
}
finally
{
EventLog.DeleteEventSource(source);
- Helpers.Retry(() => EventLog.Delete(log));
+ Helpers.RetrySilently(() => EventLog.Delete(log));
}
}
public static bool IsElevatedAndSupportsEventLogs { get => AdminHelpers.IsProcessElevated() && SupportsEventLogs; }
public static bool SupportsEventLogs { get => PlatformDetection.IsNotWindowsNanoServer && PlatformDetection.IsNotWindowsIoTCore; }
+ // Retry that eats exceptions: for "best effort cleanup"
+ public static void RetrySilently(Action func)
+ {
+ try
+ {
+ Retry(func);
+ }
+ catch
+ {}
+ }
+
public static void Retry(Action func)
{
Retry<object>(() => { func(); return null; });
RetryHelper.Execute(() =>
{
result = func();
- }, maxAttempts: 10, (iteration) => iteration * 300);
+ }, maxAttempts: 20, (iteration) => iteration * 300);
return result;
}
finally
{
EventLog.DeleteEventSource(source);
- Helpers.Retry(() => EventLog.Delete(log));
+ Helpers.RetrySilently(() => EventLog.Delete(log));
}
}