MCPcopy Create free account
hub / github.com/3rdparty/libprocess / TEST_F_TEMP_DISABLED_ON_WINDOWS

Function TEST_F_TEMP_DISABLED_ON_WINDOWS

src/tests/process_tests.cpp:1068–1096  ·  view source on GitHub ↗

Verifies that remote links will trigger an `ExitedEvent` if the link fails during socket creation. The test instigates a socket creation failure by hogging all available file descriptors. TODO(andschwa): Enable this test. The current logic will not work on Windows as " The Microsoft Winsock provider limits the maximum number of sockets supported only by available memory on the local computer." Se

Source from the content-addressed store, hash-verified

1066//
1067// https://docs.microsoft.com/en-us/windows/desktop/WinSock/maximum-number-of-sockets-supported-2 // NOLINT(whitespace/line_length)
1068TEST_F_TEMP_DISABLED_ON_WINDOWS(ProcessRemoteLinkTest, RemoteLinkLeak)
1069{
1070 RemoteLinkTestProcess relinker(pid);
1071 Future<UPID> relinkerExitedPid;
1072
1073 EXPECT_CALL(relinker, exited(pid))
1074 .WillOnce(FutureArg<0>(&relinkerExitedPid));
1075
1076 spawn(relinker);
1077
1078 // Open enough sockets to fill up all available FDs.
1079 vector<Socket> fdHogs;
1080 while (true) {
1081 Try<Socket> hog = Socket::create();
1082
1083 if (hog.isError()) {
1084 break;
1085 }
1086
1087 fdHogs.push_back(hog.get());
1088 }
1089
1090 relinker.linkup();
1091
1092 AWAIT_ASSERT_EQ(pid, relinkerExitedPid);
1093
1094 terminate(relinker);
1095 wait(relinker);
1096}
1097
1098
1099namespace process {

Callers

nothing calls this directly

Calls 6

exitedFunction · 0.85
linkupMethod · 0.80
spawnFunction · 0.50
terminateFunction · 0.50
waitFunction · 0.50
getMethod · 0.45

Tested by

no test coverage detected