🩹 Fix macOS compatibility and adjust test timing for reliability#164
Conversation
Add macOS platform detection in UnmanagedDisposable to use libSystem.B.dylib. Increase test timeouts and sleep durations in resilience test assets to improve stability on slower systems.
Greptile SummaryThis PR improves test reliability on macOS and CI environments by increasing timing tolerances and fixing a native library loading issue. All changes are confined to test assets and test files.
Confidence Score: 5/5Safe to merge — all changes are isolated to test assets and test configuration, with no production code affected. The changes widen timing tolerances in test helpers and fix a real macOS library-loading bug. The async helpers now correctly use await Task.Delay instead of blocking Thread.Sleep, and the native-library detection properly distinguishes macOS from Linux within the Unix platform branch. Nothing in production paths is touched. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[UnmanagedDisposable constructor] --> B{PlatformID.Win32NT?}
B -- Yes --> C[Load kernel32.dll]
B -- No --> D{PlatformID.Unix?}
D -- Yes --> E{RuntimeInformation.IsOSPlatform OSX?}
E -- Yes --> F[Load libSystem.B.dylib]
E -- No --> G[Load libc.so.6]
F --> H[Assign _libHandle]
G --> H
Reviews (2): Last reviewed commit: "🩹 fix latency exception handling to use..." | Re-trigger Greptile |
This pull request adjusts test timing and platform compatibility in several test files. The main changes are increased latency and jitter values in resilience and diagnostics test cases to better accommodate timing variability, and improved cross-platform support for native library loading on Unix systems.
Test timing adjustments:
TimeMeasureTestfrom 100ms to 250ms to allow for more timing variability in test execution.TransientOperationTestfrom 250ms to 500ms, making the test more tolerant to delays.TriggerLatencyExceptioninActionTransientOperation.csTriggerLatencyExceptionAsyncinAsyncActionTransientOperation.csTriggerLatencyExceptionAsyncinAsyncFuncTransientOperation.csTriggerLatencyExceptioninFuncTransientOperation.csPlatform compatibility improvements:
UnmanagedDisposableto uselibSystem.B.dylibon macOS andlibc.so.6on Linux, improving cross-platform support for Unix-based systems.