From 77f00d1b4ea883036a3d3112c0e04de56831136a Mon Sep 17 00:00:00 2001 From: Davide Grilli Date: Tue, 3 Nov 2026 13:52:49 +0100 Subject: [PATCH] test: raise the thread pool minimum to avoid starvation Property tests saturate the pool while network tests wait on continuations, so a loopback handshake could exceed its timeout and fail the run intermittently. A higher floor removes the starvation. --- tests/PalladiumWallet.Tests/ThreadPoolSetup.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tests/PalladiumWallet.Tests/ThreadPoolSetup.cs diff --git a/tests/PalladiumWallet.Tests/ThreadPoolSetup.cs b/tests/PalladiumWallet.Tests/ThreadPoolSetup.cs new file mode 100644 index 0000000..d60617c --- /dev/null +++ b/tests/PalladiumWallet.Tests/ThreadPoolSetup.cs @@ -0,0 +1,12 @@ +using System.Runtime.CompilerServices; + +namespace PalladiumWallet.Tests; + +internal static class ThreadPoolSetup +{ + // Property tests saturate the pool while network tests wait on continuations; with the + // default minimum the pool injects threads slowly and a loopback handshake can stall for + // seconds. A higher floor removes that starvation so the request timeouts stay meaningful. + [ModuleInitializer] + internal static void Init() => ThreadPool.SetMinThreads(256, 256); +}