Fixing init-test timeout.

pull/12929/head
Nicolas Noble 7 years ago committed by Nicolas "Pixel" Noble
parent b6142ef1a6
commit 850568944a
  1. 8
      src/core/lib/iomgr/iocp_windows.cc
  2. 2
      test/core/surface/init_test.c

@ -21,6 +21,7 @@
#ifdef GRPC_WINSOCK_SOCKET
#include <winsock2.h>
#include <limits>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@ -43,11 +44,14 @@ static HANDLE g_iocp;
static DWORD deadline_to_millis_timeout(grpc_exec_ctx *exec_ctx,
grpc_millis deadline) {
gpr_timespec timeout;
if (deadline == GRPC_MILLIS_INF_FUTURE) {
return INFINITE;
}
return (DWORD)GPR_MAX(0, deadline - grpc_exec_ctx_now(exec_ctx));
grpc_millis now = grpc_exec_ctx_now(exec_ctx);
if (deadline < now) return 0;
grpc_millis timeout = deadline - now;
if (timeout > std::numeric_limits<DWORD>::max()) return INFINITE;
return static_cast<DWORD>(deadline - now);
}
grpc_iocp_work_status grpc_iocp_work(grpc_exec_ctx *exec_ctx,

@ -53,7 +53,7 @@ static void test_plugin() {
}
static void test_repeatedly() {
for (int i = 0; i < 100000; i++) {
for (int i = 0; i < 1000; i++) {
grpc_init();
grpc_shutdown();
}

Loading…
Cancel
Save