Skip to content

Handle (and test) short call deadlines#9019

Merged
dgquintas merged 1 commit intogrpc:masterfrom
dgquintas:short_deadlines
Dec 10, 2016
Merged

Handle (and test) short call deadlines#9019
dgquintas merged 1 commit intogrpc:masterfrom
dgquintas:short_deadlines

Conversation

@dgquintas
Copy link
Copy Markdown
Contributor

@dgquintas dgquintas commented Dec 9, 2016

We had tests for a negative deadline. This new test uses very short deadlines instead (0-30 ms). The inspiration for this test comes from the Python issue #8389

This triggers the following failures:

grpc_end2end_test_fixture f, size_t num_ops) {
grpc_call *c;
gpr_timespec deadline = gpr_inf_past(GPR_CLOCK_REALTIME);
gpr_timespec deadline = gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not leave it as is since there is a new test covering the short deadline?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh woops. this file shouldn't have any changes. It's the one I used as the basis for the new one. I'll revert.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -0,0 +1,200 @@
/*
*
* Copyright 2015, Google Inc.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2016?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We aren't changing those things anymore I think. Perhaps for new files we are? Hmm

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

test_invoke_short_deadline_request(config, i, 5);
test_invoke_short_deadline_request(config, i, 10);
test_invoke_short_deadline_request(config, i, 15);
test_invoke_short_deadline_request(config, i, 30);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there anything to guarantee the rpc will fail with deadline exceeded (rather than succeed)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, very good point... I'll make some changes so that the server side delays long enough.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact, the test as-is will always time out, as there's no server-side logic present. I'll however add some, with the pertinent delay as mentioned, to make it explicit.

@dgquintas dgquintas changed the title Added core test for short call deadlines Handle (and test) short call deadlines Dec 9, 2016
@dgquintas dgquintas merged commit 8cbaeb8 into grpc:master Dec 10, 2016
@lock lock bot locked as resolved and limited conversation to collaborators Jan 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants