Commit fd8cb3f9 authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

rpcrt4: Reduce the timeout of waiting on the stop event in the server test to one second.

The stop event should already be signaled by the time we get to that point since we wait until the child processes terminate in the server process and the stop event is signaled in the context of one of the child processes. Don't call RpcMgmtWaitServerListening if the call to WaitForSingleObject failed since it is likely that s_stop() hasn't been called and therefore the call to RpcMgmtWaitServerListening won't ever return.
parent 9ce356c9
...@@ -1242,6 +1242,7 @@ server(void) ...@@ -1242,6 +1242,7 @@ server(void)
RPC_STATUS status, iptcp_status, np_status; RPC_STATUS status, iptcp_status, np_status;
RPC_STATUS (RPC_ENTRY *pRpcServerRegisterIfEx)(RPC_IF_HANDLE,UUID*, RPC_STATUS (RPC_ENTRY *pRpcServerRegisterIfEx)(RPC_IF_HANDLE,UUID*,
RPC_MGR_EPV*, unsigned int,unsigned int,RPC_IF_CALLBACK_FN*); RPC_MGR_EPV*, unsigned int,unsigned int,RPC_IF_CALLBACK_FN*);
DWORD ret;
iptcp_status = RpcServerUseProtseqEp(iptcp, 20, port, NULL); iptcp_status = RpcServerUseProtseqEp(iptcp, 20, port, NULL);
ok(iptcp_status == RPC_S_OK, "RpcServerUseProtseqEp(ncacn_ip_tcp) failed with status %ld\n", iptcp_status); ok(iptcp_status == RPC_S_OK, "RpcServerUseProtseqEp(ncacn_ip_tcp) failed with status %ld\n", iptcp_status);
...@@ -1278,11 +1279,17 @@ server(void) ...@@ -1278,11 +1279,17 @@ server(void)
return; return;
} }
ok(WAIT_OBJECT_0 == WaitForSingleObject(stop_event, 60000), "WaitForSingleObject\n"); ret = WaitForSingleObject(stop_event, 1000);
ok(WAIT_OBJECT_0 == ret, "WaitForSingleObject\n");
/* if the stop event didn't fire then RpcMgmtWaitServerListen will wait
* forever, so don't bother calling it in this case */
if (ret == WAIT_OBJECT_0)
{
status = RpcMgmtWaitServerListen(); status = RpcMgmtWaitServerListen();
todo_wine { todo_wine {
ok(status == RPC_S_OK, "RpcMgmtWaitServerListening failed with status %ld\n", status); ok(status == RPC_S_OK, "RpcMgmtWaitServerListening failed with status %ld\n", status);
} }
}
} }
START_TEST(server) START_TEST(server)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment