Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 27 additions & 3 deletions test/gtest/ucp/test_ucp_wireup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ class test_ucp_wireup : public ucp_test {

void waitall(std::vector<void*> reqs);

static ucs_log_func_rc_t
err_disconnect_handler(const char *file, unsigned line,
const char *function,
ucs_log_level_t level,
const ucs_log_component_config_t *comp_conf,
const char *message, va_list ap);

void disconnect(ucp_ep_h ep);

void disconnect(ucp_test::entity &e);
Expand Down Expand Up @@ -338,11 +345,28 @@ void test_ucp_wireup::send_recv(ucp_ep_h send_ep, ucp_worker_h recv_worker,
m_rkeys.clear();
}

ucs_log_func_rc_t
test_ucp_wireup::err_disconnect_handler(const char *file, unsigned line,
const char *function,
ucs_log_level_t level,
const ucs_log_component_config_t *comp_conf,
const char *message, va_list ap) {
if (level == UCS_LOG_LEVEL_ERROR) {
std::string err_str = format_message(message, ap);

if ((err_str.find("error during flush") != std::string::npos) ||
(err_str.find("completed with error") != std::string::npos) ||
(err_str.find("operation returned error")!= std::string::npos)) {
return UCS_LOG_FUNC_RC_STOP;
}
}

return UCS_LOG_FUNC_RC_CONTINUE;
}

void test_ucp_wireup::disconnect(ucp_ep_h ep) {
scoped_log_handler slh(err_disconnect_handler);
void *req = ucp_disconnect_nb(ep);
if (!UCS_PTR_IS_PTR(req)) {
ASSERT_UCS_OK(UCS_PTR_STATUS(req));
}
request_wait(req);
}

Expand Down