From 6afbf1d3f9b6f551be2dbafc97e17cd13da470ed Mon Sep 17 00:00:00 2001 From: Florian Fischer <florian.fischer@muhq.space> Date: Thu, 23 Sep 2021 18:45:45 +0200 Subject: [PATCH] [ConcurrentNetworkEchoTest] scale work with the available CPUs and log_level The chosen amounts of echos take on my 16 core ryzen system ~5seconds. This should hopefully reduce CI timeout where we are not sure if they are bugs or legit timeouts. Furthermore this should reduce the amount of logs we write and have to store after each CI run. --- tests/io/ConcurrentNetworkEchoTest.cpp | 10 ++++++++-- tests/io/meson.build | 1 - 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/io/ConcurrentNetworkEchoTest.cpp b/tests/io/ConcurrentNetworkEchoTest.cpp index 30d2c864..2b907ed8 100644 --- a/tests/io/ConcurrentNetworkEchoTest.cpp +++ b/tests/io/ConcurrentNetworkEchoTest.cpp @@ -3,13 +3,16 @@ #include <cstdlib> #include <iostream> #include <string> +#include <thread> #include <vector> #include "Common.hpp" #include "CountingPrivateSemaphore.hpp" +#include "Debug.hpp" #include "Emper.hpp" #include "Fiber.hpp" #include "Runtime.hpp" +#include "emper-config.h" #include "emper.hpp" #include "fixtures/network.hpp" #include "io.hpp" @@ -21,8 +24,8 @@ auto main(int argc, char* argv[]) -> int { exit(77); } - unsigned int client_count = 10; - unsigned int echos = 500; + unsigned int client_count = std::thread::hardware_concurrency() * 4; + unsigned int echos = EMPER_LOG_LEVEL > Info ? 250 : 25000; std::string port = "4241"; std::string host = "127.0.0.1"; @@ -40,6 +43,9 @@ auto main(int argc, char* argv[]) -> int { echos = strtol(argv[2], nullptr, DECIMAL); } + std::cout << "ConcurrentNetworkEchoTest with " << client_count << " clients sending " << echos + << " echos" << std::endl; + Runtime runtime; Fiber* listener = diff --git a/tests/io/meson.build b/tests/io/meson.build index 234a6016..9f34a0d6 100644 --- a/tests/io/meson.build +++ b/tests/io/meson.build @@ -93,6 +93,5 @@ tests += [ 'name': 'ConcurrentNetworkEchoTest', 'description': 'Concurrent network echo test with 10 clients', 'test_suite': 'io', - 'args': ['10', '10000'], }, ] -- GitLab