This is an automated email from the ASF dual-hosted git repository.

swebb2066 pushed a commit to branch fix_flaky_asyncappender_test
in repository https://gitbox.apache.org/repos/asf/logging-log4cxx.git

commit 820ffa282bfd61e98a28c4ad1b4a97c62d14f910
Author: Stephen Webb <[email protected]>
AuthorDate: Wed Oct 16 22:48:52 2024 +1100

    Prevent asyncappender test timeout
---
 src/test/cpp/asyncappendertestcase.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/test/cpp/asyncappendertestcase.cpp 
b/src/test/cpp/asyncappendertestcase.cpp
index bffa5e73..87b7d913 100644
--- a/src/test/cpp/asyncappendertestcase.cpp
+++ b/src/test/cpp/asyncappendertestcase.cpp
@@ -235,7 +235,7 @@ class AsyncAppenderTestCase : public 
AppenderSkeletonTestCase
                void testMultiThread()
                {
                        int LEN = 2000; // Larger than default buffer size (128)
-                       int threadCount = 6;
+                       int threadCount = 
max(std::thread::hardware_concurrency(), 2);
                        auto root = Logger::getRootLogger();
                        auto vectorAppender = 
std::make_shared<VectorAppender>();
                        auto asyncAppender = std::make_shared<AsyncAppender>();

Reply via email to