Skip to content

Commit

Permalink
UCT/SM/CUDA: CR Comments p3
Browse files Browse the repository at this point in the history
  • Loading branch information
brminich committed Jan 3, 2022
1 parent 558b0c9 commit 65bc359
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions test/gtest/uct/test_peer_failure.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
}

Expand All @@ -470,17 +470,21 @@ 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()
{
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)
{
Expand All @@ -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;
Expand All @@ -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);
Expand Down

0 comments on commit 65bc359

Please sign in to comment.