From 41f2f06e5451d757a2a41f46e41c9f03eec8c487 Mon Sep 17 00:00:00 2001 From: Artem Medvedev Date: Sun, 7 Jul 2024 16:52:09 +0200 Subject: [PATCH] chore: re-configure blocking runtime (#690) Include thread name and adjust number of workers --- testcontainers/src/runners/sync_runner.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/testcontainers/src/runners/sync_runner.rs b/testcontainers/src/runners/sync_runner.rs index 00df60a7..ea6e5651 100644 --- a/testcontainers/src/runners/sync_runner.rs +++ b/testcontainers/src/runners/sync_runner.rs @@ -64,6 +64,8 @@ fn lazy_sync_runner() -> Result> { // we need to use multi-thread runtime, // because we may spawn background tasks that must keep running regardless of `block_on` calls tokio::runtime::Builder::new_multi_thread() + .thread_name("testcontainers-worker") + .worker_threads(2) .enable_all() .build()?, ); @@ -96,7 +98,7 @@ mod tests { fn runtime() -> &'static Runtime { RUNTIME.get_or_init(|| { tokio::runtime::Builder::new_multi_thread() - .thread_name("testcontainers-worker") + .thread_name("testcontainers-test") .worker_threads(2) .enable_all() .build()