ref: #183
Opening this draft to make it visible to more reviewers. Quoting my comment in the issue as well:
I've added tests for four scenarios:
- Attempting to use an fd associated with a server that has already been disconnected results in a crash with: "IPC client method called after disconnect".
- Attempting to use an fd associated with a server that disconnects immediately after the first
recv(), the outcome will either be crashing with "IPC client method called after disconnect" or "IPC client method call interrupted by disconnect." This behavior seems to depend on whether therecv()call successfully reads the entirety of what is likely Capnp’s bootstrap request or only a portion of it.- Attempting to use an fd associated with a server that disconnects after a second
recv(), the process crashes with "IPC client method call interrupted by disconnect."- Attempting to use an fd associated with a server that indefinitely calls
recv()in awhileloop results in the test getting stuck at this line:It’s important to note that all of these cases call
FooInterface::initThreadMap()to invokeclientInvoke(), asConnectStream()on its own won't trigger any libmultiprocess request if there's not aconstruct()method available in the Init interface.
I'm looking for more ideas for testing ConnectStream.