From e5f07bad822d8f6f4dc98cec5256bfa26f21e1da Mon Sep 17 00:00:00 2001
From: Pavel Tsayukov
Date: Sun, 25 Aug 2024 18:37:44 +0300
Subject: [PATCH 1/5] Add tests for library/cpp/threading/future into listfile
(#205)
---
library/cpp/threading/future/CMakeLists.txt | 54 ++++++++++++++++++++-
1 file changed, 53 insertions(+), 1 deletion(-)
diff --git a/library/cpp/threading/future/CMakeLists.txt b/library/cpp/threading/future/CMakeLists.txt
index 0d4aca09b9..bf7d803832 100644
--- a/library/cpp/threading/future/CMakeLists.txt
+++ b/library/cpp/threading/future/CMakeLists.txt
@@ -1,10 +1,62 @@
+if (YDB_SDK_TESTS)
+ add_ydb_test(NAME threading-future-async_ut
+ SOURCES
+ async_ut.cpp
+ LINK_LIBRARIES
+ threading-future
+ cpp-testing-unittest_main
+ LABELS
+ unit
+ )
+
+ add_ydb_test(NAME threading-future-legacy_future_ut
+ SOURCES
+ legacy_future_ut.cpp
+ LINK_LIBRARIES
+ threading-future
+ cpp-testing-unittest_main
+ LABELS
+ unit
+ )
+
+ add_ydb_test(NAME threading-future-async_semaphore_ut
+ SOURCES
+ async_semaphore_ut.cpp
+ LINK_LIBRARIES
+ threading-future
+ cpp-testing-unittest_main
+ LABELS
+ unit
+ )
+
+ add_ydb_test(NAME threading-future-future_ut
+ SOURCES
+ future_ut.cpp
+ LINK_LIBRARIES
+ threading-future
+ cpp-testing-unittest_main
+ LABELS
+ unit
+ )
+
+ add_ydb_test(NAME threading-future-future_mt_ut
+ SOURCES
+ future_mt_ut.cpp
+ LINK_LIBRARIES
+ threading-future
+ cpp-testing-unittest_main
+ LABELS
+ unit
+ )
+endif(YDB_SDK_TESTS)
+
_ydb_sdk_add_library(threading-future)
target_link_libraries(threading-future PUBLIC
yutil
)
-target_sources(threading-future
+target_sources(threading-future
PRIVATE
async_semaphore.cpp
async.cpp
From 97ff5603842673c88950f59b1d71599be2e620a6 Mon Sep 17 00:00:00 2001
From: Pavel Tsayukov
Date: Sun, 25 Aug 2024 19:05:02 +0300
Subject: [PATCH 2/5] Increase future_mt_ut timeout (#205)
---
library/cpp/threading/future/CMakeLists.txt | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/library/cpp/threading/future/CMakeLists.txt b/library/cpp/threading/future/CMakeLists.txt
index bf7d803832..2ab67a0d52 100644
--- a/library/cpp/threading/future/CMakeLists.txt
+++ b/library/cpp/threading/future/CMakeLists.txt
@@ -48,6 +48,13 @@ if (YDB_SDK_TESTS)
LABELS
unit
)
+ set_yunittest_property(
+ TEST
+ threading-future-future_mt_ut
+ PROPERTY
+ TIMEOUT
+ 1500
+ )
endif(YDB_SDK_TESTS)
_ydb_sdk_add_library(threading-future)
From 6b2686c2cad7f3a8aed8d40ae4331ba317bc4a76 Mon Sep 17 00:00:00 2001
From: Pavel Tsayukov
Date: Thu, 12 Sep 2024 10:49:39 +0300
Subject: [PATCH 3/5] Change test label to 'unit-multithreaded' (#205)
---
library/cpp/threading/future/CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/library/cpp/threading/future/CMakeLists.txt b/library/cpp/threading/future/CMakeLists.txt
index 2ab67a0d52..c794fd03db 100644
--- a/library/cpp/threading/future/CMakeLists.txt
+++ b/library/cpp/threading/future/CMakeLists.txt
@@ -46,7 +46,7 @@ if (YDB_SDK_TESTS)
threading-future
cpp-testing-unittest_main
LABELS
- unit
+ unit-multithreaded
)
set_yunittest_property(
TEST
From a280dc35c19e6ba01f71df4de3314bbd09f6b48b Mon Sep 17 00:00:00 2001
From: Pavel Tsayukov
Date: Thu, 12 Sep 2024 12:09:43 +0300
Subject: [PATCH 4/5] Add 'release-unit-mt' preset (#205)
---
CMakePresets.json | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/CMakePresets.json b/CMakePresets.json
index 7619864d8c..fdb3c81160 100644
--- a/CMakePresets.json
+++ b/CMakePresets.json
@@ -98,6 +98,23 @@
"filter" : {
"include": {
"label": "unit"
+ },
+ "exclude": {
+ "label": "unit-multithreaded"
+ }
+ }
+ },
+ {
+ "name": "release-unit-mt",
+ "inherits": "common",
+ "configurePreset": "release-test",
+ "displayName": "Unit Release Mutlithreaded Tests",
+ "execution": {
+ "jobs": 1
+ },
+ "filter" : {
+ "include": {
+ "label": "unit-multithreaded"
}
}
},
From f433e6a10bec75d1f8f66866970bfef253e524b6 Mon Sep 17 00:00:00 2001
From: Pavel Tsayukov
Date: Thu, 12 Sep 2024 12:11:42 +0300
Subject: [PATCH 5/5] Add runner of multithreaded unit tests (#205)
---
.github/workflows/tests.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml
index fe40c3407e..12ee1b2411 100644
--- a/.github/workflows/tests.yaml
+++ b/.github/workflows/tests.yaml
@@ -53,6 +53,7 @@ jobs:
shell: bash
run: |
ctest -j32 --preset release-unit
+ ctest --preset release-unit-mt
integration:
concurrency: