[ORC] Temporarily disable RPCUtils unit test.

This broke s390x due to a bug in the QueueChannel implementation that led to it
infinite-looping. Disabling it while I look into a fix.

llvm-svn: 286917
This commit is contained in:
Lang Hames 2016-11-15 00:49:12 +00:00
parent 0fe35b158f
commit 07a6ae96fb
1 changed files with 134 additions and 133 deletions

View File

@ -93,163 +93,164 @@ private:
QueueChannel C;
};
TEST(DummyRPC, TestAsyncVoidBool) {
Queue Q1, Q2;
DummyRPCEndpoint Client(Q1, Q2);
DummyRPCEndpoint Server(Q2, Q1);
// FIXME: Temporarily disabled while the infnite loop discovered in r286639 is
// fixed (see llvm commits list discussion for that commit).
std::thread ServerThread([&]() {
Server.addHandler<DummyRPCAPI::VoidBool>(
[](bool B) {
EXPECT_EQ(B, true)
<< "Server void(bool) received unexpected result";
});
// TEST(DummyRPC, TestAsyncVoidBool) {
// Queue Q1, Q2;
// DummyRPCEndpoint Client(Q1, Q2);
// DummyRPCEndpoint Server(Q2, Q1);
{
// Poke the server to handle the negotiate call.
auto Err = Server.handleOne();
EXPECT_FALSE(!!Err) << "Server failed to handle call to negotiate";
}
// std::thread ServerThread([&]() {
// Server.addHandler<DummyRPCAPI::VoidBool>(
// [](bool B) {
// EXPECT_EQ(B, true)
// << "Server void(bool) received unexpected result";
// });
{
// Poke the server to handle the VoidBool call.
auto Err = Server.handleOne();
EXPECT_FALSE(!!Err) << "Server failed to handle call to void(bool)";
}
});
// {
// // Poke the server to handle the negotiate call.
// auto Err = Server.handleOne();
// EXPECT_FALSE(!!Err) << "Server failed to handle call to negotiate";
// }
{
// Make an async call.
auto Err = Client.callAsync<DummyRPCAPI::VoidBool>(
[](Error Err) {
EXPECT_FALSE(!!Err) << "Async void(bool) response handler failed";
return Error::success();
}, true);
EXPECT_FALSE(!!Err) << "Client.callAsync failed for void(bool)";
}
// {
// // Poke the server to handle the VoidBool call.
// auto Err = Server.handleOne();
// EXPECT_FALSE(!!Err) << "Server failed to handle call to void(bool)";
// }
// });
{
// Poke the client to process the result of the void(bool) call.
auto Err = Client.handleOne();
EXPECT_FALSE(!!Err) << "Client failed to handle response from void(bool)";
}
// {
// // Make an async call.
// auto Err = Client.callAsync<DummyRPCAPI::VoidBool>(
// [](Error Err) {
// EXPECT_FALSE(!!Err) << "Async void(bool) response handler failed";
// return Error::success();
// }, true);
// EXPECT_FALSE(!!Err) << "Client.callAsync failed for void(bool)";
// }
ServerThread.join();
}
// {
// // Poke the client to process the result of the void(bool) call.
// auto Err = Client.handleOne();
// EXPECT_FALSE(!!Err) << "Client failed to handle response from void(bool)";
// }
TEST(DummyRPC, TestAsyncIntInt) {
Queue Q1, Q2;
DummyRPCEndpoint Client(Q1, Q2);
DummyRPCEndpoint Server(Q2, Q1);
// ServerThread.join();
// }
std::thread ServerThread([&]() {
Server.addHandler<DummyRPCAPI::IntInt>(
[](int X) -> int {
EXPECT_EQ(X, 21) << "Server int(int) receieved unexpected result";
return 2 * X;
});
// TEST(DummyRPC, TestAsyncIntInt) {
// Queue Q1, Q2;
// DummyRPCEndpoint Client(Q1, Q2);
// DummyRPCEndpoint Server(Q2, Q1);
{
// Poke the server to handle the negotiate call.
auto Err = Server.handleOne();
EXPECT_FALSE(!!Err) << "Server failed to handle call to negotiate";
}
// std::thread ServerThread([&]() {
// Server.addHandler<DummyRPCAPI::IntInt>(
// [](int X) -> int {
// EXPECT_EQ(X, 21) << "Server int(int) receieved unexpected result";
// return 2 * X;
// });
{
// Poke the server to handle the int(int) call.
auto Err = Server.handleOne();
EXPECT_FALSE(!!Err) << "Server failed to handle call to int(int)";
}
});
// {
// // Poke the server to handle the negotiate call.
// auto Err = Server.handleOne();
// EXPECT_FALSE(!!Err) << "Server failed to handle call to negotiate";
// }
{
auto Err = Client.callAsync<DummyRPCAPI::IntInt>(
[](Expected<int> Result) {
EXPECT_TRUE(!!Result) << "Async int(int) response handler failed";
EXPECT_EQ(*Result, 42)
<< "Async int(int) response handler received incorrect result";
return Error::success();
}, 21);
EXPECT_FALSE(!!Err) << "Client.callAsync failed for int(int)";
}
// {
// // Poke the server to handle the int(int) call.
// auto Err = Server.handleOne();
// EXPECT_FALSE(!!Err) << "Server failed to handle call to int(int)";
// }
// });
{
// Poke the client to process the result.
auto Err = Client.handleOne();
EXPECT_FALSE(!!Err) << "Client failed to handle response from void(bool)";
}
// {
// auto Err = Client.callAsync<DummyRPCAPI::IntInt>(
// [](Expected<int> Result) {
// EXPECT_TRUE(!!Result) << "Async int(int) response handler failed";
// EXPECT_EQ(*Result, 42)
// << "Async int(int) response handler received incorrect result";
// return Error::success();
// }, 21);
// EXPECT_FALSE(!!Err) << "Client.callAsync failed for int(int)";
// }
ServerThread.join();
}
// {
// // Poke the client to process the result.
// auto Err = Client.handleOne();
// EXPECT_FALSE(!!Err) << "Client failed to handle response from void(bool)";
// }
TEST(DummyRPC, TestSerialization) {
Queue Q1, Q2;
DummyRPCEndpoint Client(Q1, Q2);
DummyRPCEndpoint Server(Q2, Q1);
// ServerThread.join();
// }
std::thread ServerThread([&]() {
Server.addHandler<DummyRPCAPI::AllTheTypes>(
[&](int8_t S8, uint8_t U8, int16_t S16, uint16_t U16,
int32_t S32, uint32_t U32, int64_t S64, uint64_t U64,
bool B, std::string S, std::vector<int> V) {
// TEST(DummyRPC, TestSerialization) {
// Queue Q1, Q2;
// DummyRPCEndpoint Client(Q1, Q2);
// DummyRPCEndpoint Server(Q2, Q1);
EXPECT_EQ(S8, -101) << "int8_t serialization broken";
EXPECT_EQ(U8, 250) << "uint8_t serialization broken";
EXPECT_EQ(S16, -10000) << "int16_t serialization broken";
EXPECT_EQ(U16, 10000) << "uint16_t serialization broken";
EXPECT_EQ(S32, -1000000000) << "int32_t serialization broken";
EXPECT_EQ(U32, 1000000000ULL) << "uint32_t serialization broken";
EXPECT_EQ(S64, -10000000000) << "int64_t serialization broken";
EXPECT_EQ(U64, 10000000000ULL) << "uint64_t serialization broken";
EXPECT_EQ(B, true) << "bool serialization broken";
EXPECT_EQ(S, "foo") << "std::string serialization broken";
EXPECT_EQ(V, std::vector<int>({42, 7}))
<< "std::vector serialization broken";
return Error::success();
});
// std::thread ServerThread([&]() {
// Server.addHandler<DummyRPCAPI::AllTheTypes>(
// [&](int8_t S8, uint8_t U8, int16_t S16, uint16_t U16,
// int32_t S32, uint32_t U32, int64_t S64, uint64_t U64,
// bool B, std::string S, std::vector<int> V) {
{
// Poke the server to handle the negotiate call.
auto Err = Server.handleOne();
EXPECT_FALSE(!!Err) << "Server failed to handle call to negotiate";
}
// EXPECT_EQ(S8, -101) << "int8_t serialization broken";
// EXPECT_EQ(U8, 250) << "uint8_t serialization broken";
// EXPECT_EQ(S16, -10000) << "int16_t serialization broken";
// EXPECT_EQ(U16, 10000) << "uint16_t serialization broken";
// EXPECT_EQ(S32, -1000000000) << "int32_t serialization broken";
// EXPECT_EQ(U32, 1000000000ULL) << "uint32_t serialization broken";
// EXPECT_EQ(S64, -10000000000) << "int64_t serialization broken";
// EXPECT_EQ(U64, 10000000000ULL) << "uint64_t serialization broken";
// EXPECT_EQ(B, true) << "bool serialization broken";
// EXPECT_EQ(S, "foo") << "std::string serialization broken";
// EXPECT_EQ(V, std::vector<int>({42, 7}))
// << "std::vector serialization broken";
// return Error::success();
// });
{
// Poke the server to handle the AllTheTypes call.
auto Err = Server.handleOne();
EXPECT_FALSE(!!Err) << "Server failed to handle call to void(bool)";
}
});
// {
// // Poke the server to handle the negotiate call.
// auto Err = Server.handleOne();
// EXPECT_FALSE(!!Err) << "Server failed to handle call to negotiate";
// }
// {
// // Poke the server to handle the AllTheTypes call.
// auto Err = Server.handleOne();
// EXPECT_FALSE(!!Err) << "Server failed to handle call to void(bool)";
// }
// });
{
// Make an async call.
std::vector<int> v({42, 7});
auto Err = Client.callAsync<DummyRPCAPI::AllTheTypes>(
[](Error Err) {
EXPECT_FALSE(!!Err) << "Async AllTheTypes response handler failed";
return Error::success();
},
static_cast<int8_t>(-101), static_cast<uint8_t>(250),
static_cast<int16_t>(-10000), static_cast<uint16_t>(10000),
static_cast<int32_t>(-1000000000), static_cast<uint32_t>(1000000000),
static_cast<int64_t>(-10000000000), static_cast<uint64_t>(10000000000),
true, std::string("foo"), v);
EXPECT_FALSE(!!Err) << "Client.callAsync failed for AllTheTypes";
}
// {
// // Make an async call.
// std::vector<int> v({42, 7});
// auto Err = Client.callAsync<DummyRPCAPI::AllTheTypes>(
// [](Error Err) {
// EXPECT_FALSE(!!Err) << "Async AllTheTypes response handler failed";
// return Error::success();
// },
// static_cast<int8_t>(-101), static_cast<uint8_t>(250),
// static_cast<int16_t>(-10000), static_cast<uint16_t>(10000),
// static_cast<int32_t>(-1000000000), static_cast<uint32_t>(1000000000),
// static_cast<int64_t>(-10000000000), static_cast<uint64_t>(10000000000),
// true, std::string("foo"), v);
// EXPECT_FALSE(!!Err) << "Client.callAsync failed for AllTheTypes";
// }
{
// Poke the client to process the result of the AllTheTypes call.
auto Err = Client.handleOne();
EXPECT_FALSE(!!Err) << "Client failed to handle response from AllTheTypes";
}
// {
// // Poke the client to process the result of the AllTheTypes call.
// auto Err = Client.handleOne();
// EXPECT_FALSE(!!Err) << "Client failed to handle response from AllTheTypes";
// }
ServerThread.join();
}
// ServerThread.join();
// }
// Test the synchronous call API.
// FIXME: Re-enable once deadlock encountered on S390 has been debugged / fixed,
// see http://lab.llvm.org:8011/builders/clang-s390x-linux/builds/3459
// TEST_F(DummyRPC, TestSynchronousCall) {
// Queue Q1, Q2;
// QueueChannel C1(Q1, Q2);