diff --git a/test/gtest/uct/ib/test_rc.cc b/test/gtest/uct/ib/test_rc.cc index 2e862dc87c2..552dcfb9ebf 100644 --- a/test/gtest/uct/ib/test_rc.cc +++ b/test/gtest/uct/ib/test_rc.cc @@ -77,6 +77,9 @@ void test_rc_flow_control::init() } test_rc::init(); + ucs_assert(rc_iface(m_e1)->config.fc_enabled); + ucs_assert(rc_iface(m_e2)->config.fc_enabled); + uct_iface_set_am_handler(m_e1->iface(), FLUSH_AM_ID, am_handler, NULL, UCT_CB_FLAG_SYNC); uct_iface_set_am_handler(m_e2->iface(), FLUSH_AM_ID, am_handler, @@ -84,6 +87,14 @@ void test_rc_flow_control::init() } +void test_rc_flow_control::cleanup() +{ + /* Restore FC state to enabled, so iface cleanup will destroy the grant mpool */ + rc_iface(m_e1)->config.fc_enabled = 1; + rc_iface(m_e2)->config.fc_enabled = 1; + test_rc::cleanup(); +} + void test_rc_flow_control::send_am_and_flush(entity *e, int num_msg) { m_am_rx_count = 0; diff --git a/test/gtest/uct/ib/test_rc.h b/test/gtest/uct/ib/test_rc.h index 8668c61ab90..d4437035fe9 100644 --- a/test/gtest/uct/ib/test_rc.h +++ b/test/gtest/uct/ib/test_rc.h @@ -60,6 +60,7 @@ class test_rc_flow_control : public test_rc { } pending_send_request_t; void init(); + void cleanup(); virtual uct_rc_fc_t* get_fc_ptr(entity *e, int ep_idx = 0) { return &rc_ep(e, ep_idx)->fc; @@ -87,7 +88,7 @@ class test_rc_flow_control : public test_rc { void set_fc_disabled(entity *e) { /* same as default settings in rc_iface_init */ - set_fc_attributes(m_e1, false, std::numeric_limits::max(), 0, 0); + set_fc_attributes(e, false, std::numeric_limits::max(), 0, 0); } void send_am_and_flush(entity *e, int num_msg);