aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorGravatar ncteisen <ncteisen@gmail.com>2017-10-26 08:58:22 -0700
committerGravatar ncteisen <ncteisen@gmail.com>2017-10-26 09:03:50 -0700
commitf06d42ad4c18b0783ddfafc039e90dd9d8435cf7 (patch)
tree954b8af4aa77c5b476fa9fb58e7435a5286aae52 /test
parent255c590bc62c4f2d74804631df6784bc9b023fb0 (diff)
Fix test timing bug:
Diffstat (limited to 'test')
-rw-r--r--test/core/transport/status_conversion_test.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/core/transport/status_conversion_test.c b/test/core/transport/status_conversion_test.c
index de8fa4458a..1a437046e8 100644
--- a/test/core/transport/status_conversion_test.c
+++ b/test/core/transport/status_conversion_test.c
@@ -16,6 +16,8 @@
*
*/
+#include <unistd.h>
+
#include "src/core/lib/transport/status_conversion.h"
#include <grpc/support/log.h>
#include "test/core/util/test_config.h"
@@ -38,6 +40,7 @@ int main(int argc, char **argv) {
int i;
grpc_test_init(argc, argv);
+ grpc_init();
GRPC_STATUS_TO_HTTP2_ERROR(GRPC_STATUS_OK, GRPC_HTTP2_NO_ERROR);
GRPC_STATUS_TO_HTTP2_ERROR(GRPC_STATUS_CANCELLED, GRPC_HTTP2_CANCEL);
@@ -129,6 +132,7 @@ int main(int argc, char **argv) {
GRPC_STATUS_INTERNAL);
HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_REFUSED_STREAM, after_deadline,
GRPC_STATUS_UNAVAILABLE);
+ sleep(1);
HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_CANCEL, after_deadline,
GRPC_STATUS_DEADLINE_EXCEEDED);
HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_COMPRESSION_ERROR, after_deadline,
@@ -158,5 +162,7 @@ int main(int argc, char **argv) {
grpc_http2_status_to_grpc_status(i);
}
+ grpc_shutdown();
+
return 0;
}