| 51 | } |
| 52 | |
| 53 | TEST_F(RendezvousUtilTest, SendBeforeRecv) { |
| 54 | // Fire off sends before receive the tensors. |
| 55 | TF_ASSERT_OK(SendTensorsToRendezvous( |
| 56 | rendez_, nullptr, {}, {MakeStringKey("hello1"), MakeStringKey("hello2")}, |
| 57 | {V("hello1"), V("hello2")})); |
| 58 | |
| 59 | Notification n; |
| 60 | std::vector<Tensor> received_keys; |
| 61 | RecvOutputsFromRendezvousAsync( |
| 62 | rendez_, nullptr, {}, {MakeStringKey("hello1"), MakeStringKey("hello2")}, |
| 63 | &received_keys, [&n](const Status& status) { n.Notify(); }); |
| 64 | n.WaitForNotification(); |
| 65 | |
| 66 | EXPECT_EQ(2, received_keys.size()); |
| 67 | EXPECT_EQ("hello1", V(received_keys[0])); |
| 68 | EXPECT_EQ("hello2", V(received_keys[1])); |
| 69 | } |
| 70 | |
| 71 | TEST_F(RendezvousUtilTest, RecvBeforeSend) { |
| 72 | // Fire off recvs, wait for a notification in the callback. |
nothing calls this directly
no test coverage detected