Skip to content

Commit 2dd6c65

Browse files
committed
TEST/GTEST: Disable tag matching offload tests
1 parent 6df8f3c commit 2dd6c65

File tree

8 files changed

+64
-5
lines changed

8 files changed

+64
-5
lines changed

test/gtest/common/test.cc

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,16 @@ test_base::~test_base() {
4040
}
4141
ucs_assertv_always(m_state == FINISHED ||
4242
m_state == SKIPPED ||
43-
m_state == NEW || /* can be skipped from a class constructor */
43+
m_state == NEW ||
44+
m_state == INITIALIZING ||
4445
m_state == ABORTED,
4546
"state=%d", m_state);
4647
}
4748

4849
void test_base::set_num_threads(unsigned num_threads) {
49-
if (m_state != NEW) {
50+
if (m_state == SKIPPED) {
51+
return;
52+
} else if (m_state != NEW) {
5053
GTEST_FAIL() << "Cannot modify number of threads after test is started, "
5154
<< "it must be done in the constructor.";
5255
}
@@ -311,6 +314,10 @@ unsigned test_base::num_warnings()
311314
}
312315

313316
void test_base::SetUpProxy() {
317+
if (m_state == SKIPPED) {
318+
return;
319+
}
320+
314321
ucs_assert(m_state == NEW);
315322
m_num_valgrind_errors_before = VALGRIND_COUNT_ERRORS;
316323
m_num_warnings_before = m_total_warnings;
@@ -324,6 +331,7 @@ void test_base::SetUpProxy() {
324331

325332
try {
326333
check_skip_test();
334+
m_state = INITIALIZING;
327335
init();
328336
m_initialized = true;
329337
m_state = RUNNING;
@@ -427,7 +435,10 @@ void test_base::TestBodyProxy() {
427435
}
428436

429437
void test_base::skipped(const test_skip_exception& e) {
430-
std::string reason = e.what();
438+
skipped(e.what());
439+
}
440+
441+
void test_base::skipped(const std::string& reason) {
431442
if (reason.empty()) {
432443
detail::message_stream("SKIP");
433444
} else {
@@ -459,6 +470,14 @@ bool test_base::barrier() {
459470
}
460471
}
461472

473+
void test_base::test_skip(const std::string& reason) {
474+
if (m_state == NEW) {
475+
skipped(reason); // Do not throw exception from the constructor
476+
} else if (m_state != SKIPPED) {
477+
throw test_skip_exception(reason);
478+
}
479+
}
480+
462481
static void clear_dontcopy_regions_vma_cb(ucs_sys_vma_info_t *info, void *ctx) {
463482
int ret;
464483

test/gtest/common/test.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,12 @@ class test_base {
7070
};
7171

7272
typedef enum {
73-
NEW, RUNNING, SKIPPED, ABORTED, FINISHED
73+
NEW,
74+
INITIALIZING,
75+
RUNNING,
76+
SKIPPED,
77+
ABORTED,
78+
FINISHED
7479
} state_t;
7580

7681
typedef std::vector<ucs_global_opts_t> config_stack_t;
@@ -85,6 +90,7 @@ class test_base {
8590
virtual void cleanup();
8691
virtual void init();
8792
bool barrier();
93+
void test_skip(const std::string &reason = "");
8894

8995
virtual void check_skip_test() = 0;
9096

@@ -174,6 +180,7 @@ class test_base {
174180
static std::vector<std::string> m_first_warns_and_errors;
175181

176182
private:
183+
void skipped(const std::string &reason);
177184
void skipped(const test_skip_exception& e);
178185
void run();
179186
static void push_debug_message_with_limit(std::vector<std::string>& vec,

test/gtest/common/test_helpers.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -924,4 +924,10 @@ void skip_on_address_sanitizer()
924924
#endif
925925
}
926926

927+
bool skip_hw_tm_offload()
928+
{
929+
// Skip HW TM offload tests due to issue RM4602065
930+
return true;
931+
}
932+
927933
} // ucs

test/gtest/common/test_helpers.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,6 +1056,13 @@ const std::vector<std::vector<ucs_memory_type_t> >& supported_mem_type_pairs();
10561056
*/
10571057
void skip_on_address_sanitizer();
10581058

1059+
1060+
/**
1061+
* Returns whether to skip HW TM offload tests
1062+
*/
1063+
bool skip_hw_tm_offload();
1064+
1065+
10591066
/**
10601067
* Class for mocking C function pointers
10611068
* The class is used to mock C function pointers, by replacing the original

test/gtest/ucp/test_ucp_tag.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ void test_ucp_tag::init()
5656

5757
void test_ucp_tag::enable_tag_mp_offload()
5858
{
59+
if (ucs::skip_hw_tm_offload()) {
60+
test_skip();
61+
}
5962
m_env.push_back(new ucs::scoped_setenv("UCX_RC_TM_ENABLE", "y"));
6063
m_env.push_back(new ucs::scoped_setenv("UCX_RC_TM_MP_SRQ_ENABLE", "try"));
6164
m_env.push_back(new ucs::scoped_setenv("UCX_RC_TM_MP_NUM_STRIDES", "8"));
@@ -425,6 +428,9 @@ class test_ucp_tag_limits : public test_ucp_tag {
425428
test_ucp_tag_limits() {
426429
m_test_offload = get_variant_value();
427430
if (m_test_offload) {
431+
if (ucs::skip_hw_tm_offload()) {
432+
test_skip();
433+
}
428434
m_env.push_back(new ucs::scoped_setenv("UCX_RC_TM_ENABLE", "y"));
429435
}
430436
m_tag_min_rndv = 0;

test/gtest/ucp/test_ucp_tag_offload.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,9 @@ UCP_INSTANTIATE_TEST_CASE_TLS(test_ucp_tag_offload_multi, all_rcdc, "rc,dc")
593593
class test_ucp_tag_offload_selection : public test_ucp_tag_offload {
594594
public:
595595
test_ucp_tag_offload_selection() {
596+
if (ucs::skip_hw_tm_offload()) {
597+
test_skip();
598+
}
596599
m_env.push_back(new ucs::scoped_setenv("UCX_RC_TM_ENABLE", "y"));
597600
}
598601

@@ -708,6 +711,9 @@ UCP_INSTANTIATE_TEST_CASE_TLS_GPU_AWARE(test_ucp_tag_offload_gpu, rc_dc_gpu,
708711
class test_ucp_tag_offload_status : public test_ucp_tag {
709712
public:
710713
test_ucp_tag_offload_status() {
714+
if (ucs::skip_hw_tm_offload()) {
715+
test_skip();
716+
}
711717
m_env.push_back(new ucs::scoped_setenv("UCX_RC_TM_ENABLE", "y"));
712718
}
713719

test/gtest/uct/ib/test_rc.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,9 @@ class test_rc_get_limit : public test_rc {
289289
modify_config("RC_TX_QUEUE_LEN", "32");
290290
}
291291

292-
modify_config("RC_TM_ENABLE", "y", SETENV_IF_NOT_EXIST);
292+
if (!ucs::skip_hw_tm_offload()) {
293+
modify_config("RC_TM_ENABLE", "y", SETENV_IF_NOT_EXIST);
294+
}
293295

294296
m_comp.func = NULL;
295297
m_comp.count = 300000; // some big value to avoid func invocation

test/gtest/uct/test_tag.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ class test_tag : public uct_test {
5454

5555
void init()
5656
{
57+
if (ucs::skip_hw_tm_offload()) {
58+
test_skip();
59+
}
5760
ucs_status_t status = uct_config_modify(m_iface_config,
5861
"RC_TM_ENABLE", "y");
5962
ASSERT_TRUE((status == UCS_OK) || (status == UCS_ERR_NO_ELEM));
@@ -1015,6 +1018,9 @@ void test_tag_mp_xrq::set_env_var_or_skip(void *config, const char *var,
10151018

10161019
void test_tag_mp_xrq::init()
10171020
{
1021+
if (ucs::skip_hw_tm_offload()) {
1022+
test_skip();
1023+
}
10181024
set_env_var_or_skip(m_iface_config, "RC_TM_ENABLE", "y");
10191025
set_env_var_or_skip(m_iface_config, "RC_TM_MP_SRQ_ENABLE", "try");
10201026
set_env_var_or_skip(m_iface_config, "RC_TM_MP_NUM_STRIDES", "8");

0 commit comments

Comments
 (0)