Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 3 additions & 2 deletions test/Cuemon.Core.Tests/Assets/UnmanagedDisposable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ public UnmanagedDisposable()
}
else if (Environment.OSVersion.Platform == PlatformID.Unix)
{
if (NativeLibrary.TryLoad("libc.so.6", GetType().Assembly, DllImportSearchPath.SafeDirectories, out _libHandle))
var libraryName = RuntimeInformation.IsOSPlatform(OSPlatform.OSX) ? "libSystem.B.dylib" : "libc.so.6";
if (NativeLibrary.TryLoad(libraryName, GetType().Assembly, DllImportSearchPath.SafeDirectories, out _libHandle))
{
_handle = _libHandle; // i don't know of any native methods on unix
}
Expand Down Expand Up @@ -119,4 +120,4 @@ protected override void OnDisposeUnmanagedResources()
#endif
}
}
}
}
4 changes: 2 additions & 2 deletions test/Cuemon.Diagnostics.Tests/TimeMeasureTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Cuemon.Diagnostics
public class TimeMeasureTest : Test
{
private static readonly TimeSpan ExpectedExecutionTime = TimeSpan.FromSeconds(1);
private static readonly TimeSpan Jitter = TimeSpan.FromMilliseconds(100);
private static readonly TimeSpan Jitter = TimeSpan.FromMilliseconds(250);

public TimeMeasureTest(ITestOutputHelper output) : base(output)
{
Expand Down Expand Up @@ -1288,4 +1288,4 @@ public void WithAction_ShouldHaveStoppedProfiler_WhenCompleted()
Assert.False(profiler.Timer.IsRunning);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static void TriggerTransientFaultException(Guid id, ConcurrentDictionary<

public static void TriggerLatencyException(Guid id, ConcurrentDictionary<Guid, int> retryTracker)
{
Thread.Sleep(250);
Thread.Sleep(750);
retryTracker[id] += 1;
throw new HttpRequestException();
}
Expand All @@ -38,4 +38,4 @@ public static void FailWithNonTransientFaultException(Guid id, int expectedRetry
throw new InvalidOperationException();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static Task TriggerTransientFaultExceptionAsync(Guid id, ConcurrentDictio

public static Task TriggerLatencyExceptionAsync(Guid id, ConcurrentDictionary<Guid, int> retryTracker, CancellationToken ct)
{
Thread.Sleep(250);
Thread.Sleep(750);
retryTracker[id] += 1;
throw new HttpRequestException();
}
Comment thread
greptile-apps[bot] marked this conversation as resolved.
Outdated
Expand All @@ -41,4 +41,4 @@ public static Task FailWithNonTransientFaultExceptionAsync(Guid id, int expected
throw new InvalidOperationException();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static Task<string> TriggerTransientFaultExceptionAsync(Guid id, Concurre

public static Task<string> TriggerLatencyExceptionAsync(Guid id, ConcurrentDictionary<Guid, int> retryTracker, CancellationToken ct)
{
Thread.Sleep(350);
Thread.Sleep(750);
retryTracker[id] += 1;
throw new HttpRequestException();
}
Expand All @@ -41,4 +41,4 @@ public static Task<string> FailWithNonTransientFaultExceptionAsync(Guid id, int
throw new InvalidOperationException();
}
}
}
}
4 changes: 2 additions & 2 deletions test/Cuemon.Resilience.Tests/Assets/FuncTransientOperation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public static string TriggerTransientFaultException(Guid id, ConcurrentDictionar

public static string TriggerLatencyException(Guid id, ConcurrentDictionary<Guid, int> retryTracker)
{
Thread.Sleep(250);
Thread.Sleep(750);
retryTracker[id] += 1;
throw new HttpRequestException();
}
Expand All @@ -40,4 +40,4 @@ public static string FailWithNonTransientFaultException(Guid id, int expectedRet
throw new InvalidOperationException();
}
}
}
}
4 changes: 2 additions & 2 deletions test/Cuemon.Resilience.Tests/TransientOperationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class TransientOperationTest : Test
private const int NormalRunIncrement = 1;
private const int DescriptiveExceptionCauseIncrement = 1;
private static readonly TimeSpan ExpectedRecoveryWaitTime = TimeSpan.FromSeconds(1);
private static readonly TimeSpan ExpectedMaximumAllowedLatency = TimeSpan.FromMilliseconds(250);
private static readonly TimeSpan ExpectedMaximumAllowedLatency = TimeSpan.FromMilliseconds(500);

public TransientOperationTest(ITestOutputHelper output) : base(output)
{
Expand Down Expand Up @@ -382,4 +382,4 @@ public async Task WithFuncAsync_ShouldTriggerInvalidOperationException()
Assert.Equal(ExpectedRetryAttempts, _retryTracker[id]);
}
}
}
}
Loading