-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Closed
Description
The follow unit test has the title SimpleUnbufferedChannelTest
Paddle/paddle/framework/channel_test.cc
Lines 85 to 104 in 4716825
| TEST(Channel, SimpleUnbufferedChannelTest) { | |
| auto ch = MakeChannel<int>(0); | |
| unsigned sum_send = 0; | |
| std::thread t([&]() { | |
| for (int i = 0; i < 5; i++) { | |
| EXPECT_EQ(ch->Send(&i), true); | |
| sum_send += i; | |
| } | |
| }); | |
| for (int i = 0; i < 5; i++) { | |
| int recv; | |
| EXPECT_EQ(ch->Receive(&recv), true); | |
| EXPECT_EQ(recv, i); | |
| } | |
| CloseChannel(ch); | |
| t.join(); | |
| EXPECT_EQ(sum_send, 10U); | |
| delete ch; | |
| } |
This implies that it is specifically design to test unbuffered channels.
However, the logic would pass with buffered channels too.
It seems that we should
- either rename it to SimpleChannelTest -- remove the word "Unbuffered", or
- rewrite it so that it works with unbuffered channel and fails with buffered channels.
Metadata
Metadata
Assignees
Labels
No labels