Skip to content

Commit 2458519

Browse files
committed
cloud_roles: run setenv on reactor thread
This patch changes boost tests that call setenv so that they run on a reactor thread rather than the main thread. Without this change we end up hitting this assertion: test_cloud_roles_rpunit: /home/nwatkins/src/redpanda/vbuild/release/clang/v_deps_build/seastar-prefix/src/seastar/src/core/memory.cc:986: void seastar::memory::cpu_pages::shrink(void *, size_t): Assertion `object_cpu_id(ptr) == cpu_id' failed. NOTE: it is not clear that this really fixes the issue, but at least the issue doesn't appear to happen anymore. According to this seastar-dev thread setenv is interacting with global state and the realloc that it performs may involve some mixture of memory accessed by different cores, before/after the low-level allocators are swapped out by seastar. https://groups.google.com/g/seastar-dev/c/hSdTKn05Ei8/m/cH4bFvmEAgAJ Overall it seems like we might want to consider getting rid of setenv calls. There is only one in Redpanda proper (krb5 stuff). Signed-off-by: Noah Watkins <[email protected]>
1 parent 5739779 commit 2458519

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/v/cloud_roles/tests/categorization_tests.cc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@
1313

1414
#include <seastar/core/abort_source.hh>
1515
#include <seastar/core/gate.hh>
16-
17-
#include <boost/test/unit_test.hpp>
16+
#include <seastar/testing/thread_test_case.hh>
1817

1918
inline ss::logger test_log("test"); // NOLINT
2019

21-
BOOST_AUTO_TEST_CASE(test_refresh_client_built_according_to_source) {
20+
SEASTAR_THREAD_TEST_CASE(test_refresh_client_built_according_to_source) {
2221
ss::abort_source as;
2322
cloud_roles::aws_region_name region{"atlantis"};
2423
{
@@ -66,7 +65,7 @@ BOOST_AUTO_TEST_CASE(test_refresh_client_built_according_to_source) {
6665
std::invalid_argument);
6766
}
6867

69-
BOOST_AUTO_TEST_CASE(
68+
SEASTAR_THREAD_TEST_CASE(
7069
test_credential_applier_built_according_to_credential_kind) {
7170
{
7271
cloud_roles::gcp_credentials gc{};

src/v/cloud_roles/tests/env_override_tests.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@
1111
#include "cloud_roles/refresh_credentials.h"
1212

1313
#include <seastar/core/gate.hh>
14+
#include <seastar/testing/thread_test_case.hh>
1415
#include <seastar/util/defer.hh>
1516

1617
#include <boost/test/unit_test.hpp>
1718

18-
BOOST_AUTO_TEST_CASE(test_override_address) {
19+
SEASTAR_THREAD_TEST_CASE(test_override_address) {
1920
ss::abort_source as;
2021
cloud_roles::aws_region_name region{"atlantis"};
2122

@@ -39,7 +40,7 @@ BOOST_AUTO_TEST_CASE(test_override_address) {
3940
}
4041
}
4142

42-
BOOST_AUTO_TEST_CASE(test_override_address_fails_on_bad_address) {
43+
SEASTAR_THREAD_TEST_CASE(test_override_address_fails_on_bad_address) {
4344
ss::abort_source as;
4445
cloud_roles::aws_region_name region{"atlantis"};
4546

0 commit comments

Comments
 (0)