From 65bc359540d306688b6eb3885cfa30d1847b3c09 Mon Sep 17 00:00:00 2001 From: Mikhail Brinskii Date: Mon, 3 Jan 2022 12:47:02 +0200 Subject: [PATCH] UCT/SM/CUDA: CR Comments p3 --- test/gtest/uct/test_peer_failure.cc | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/test/gtest/uct/test_peer_failure.cc b/test/gtest/uct/test_peer_failure.cc index 7a09220c6abd..19b281078e97 100644 --- a/test/gtest/uct/test_peer_failure.cc +++ b/test/gtest/uct/test_peer_failure.cc @@ -461,7 +461,7 @@ UCT_INSTANTIATE_TEST_CASE(test_uct_peer_failure_multiple) class test_uct_keepalive : public uct_test { public: test_uct_keepalive() : - m_ka(NULL), m_pid(getpid()), m_entity(NULL), m_err_handler_count(0) + m_pid(getpid()), m_entity(NULL), m_err_handler_count(0) { } @@ -470,10 +470,7 @@ class test_uct_keepalive : public uct_test { m_entity = create_entity(0, err_handler_cb); m_entity->connect(0, *m_entity, 0); m_entities.push_back(m_entity); - ASSERT_TRUE(has_mm()); - uct_mm_ep_t *ep = ucs_derived_of(m_entity->ep(0), uct_mm_ep_t); - m_ka = &ep->keepalive; } void cleanup() @@ -481,6 +478,13 @@ class test_uct_keepalive : public uct_test { m_entities.clear(); } + uct_keepalive_info_t *m_ka() + { + uct_mm_ep_t *ep = ucs_derived_of(m_entity->ep(0), uct_mm_ep_t); + + return &ep->keepalive; + } + static ucs_status_t err_handler_cb(void *arg, uct_ep_h ep, ucs_status_t status) { @@ -492,12 +496,11 @@ class test_uct_keepalive : public uct_test { protected: void do_keepalive() { - ucs_status_t status = uct_ep_keepalive_check(m_entity->ep(0), m_ka, + ucs_status_t status = uct_ep_keepalive_check(m_entity->ep(0), m_ka(), m_pid, 0, NULL); EXPECT_UCS_OK(status); } - uct_keepalive_info_t *m_ka; pid_t m_pid; entity *m_entity; unsigned m_err_handler_count; @@ -511,7 +514,7 @@ UCS_TEST_P(test_uct_keepalive, ep_check) EXPECT_EQ(0u, m_err_handler_count); /* change start time saved in KA to force an error from EP check */ - m_ka->start_time--; + m_ka()->start_time--; do_keepalive(); EXPECT_EQ(0u, m_err_handler_count);