Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for specifying timeouts #715

Merged
merged 11 commits into from
Nov 28, 2023
Merged

Conversation

smaye81
Copy link
Member

@smaye81 smaye81 commented Nov 28, 2023

This adds support for specifying timeouts and adds unit tests for validating context deadlines. In doing so, it fixes the expectations so that the test library validates servers are returning the received TimeoutMs.

@@ -359,6 +359,15 @@ func populateExpectedResponse(testCase *conformancev1.TestCase) error {
}
}

// Converts a pointer to a uint32 value into a pointer to an int64.
// If the pointer is nil, function returns nil.
func convertToInt64Ptr(num *uint32) *int64 {
Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure if there's a better way to do this.

@@ -140,6 +144,9 @@ message UnaryResponseDefinition {
// Response trailers to send - together with the error if present
repeated Header response_trailers = 4;

// Wait this many milliseconds before sending a response message
uint32 response_delay_ms = 6;
Copy link
Member Author

Choose a reason for hiding this comment

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

Realized there was no way to specify a response delay for unary responses.

@@ -73,6 +73,21 @@ testCases:
responseTrailers:
- name: x-custom-trailer
value: ["bing","quux"]
- request:
Copy link
Member Author

Choose a reason for hiding this comment

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

Bidi's seem to be failing timeouts. Investigating in a separate PR.

@smaye81 smaye81 requested a review from jhump November 28, 2023 21:42
@smaye81 smaye81 merged commit fb02a2a into sayers/response_def Nov 28, 2023
@smaye81 smaye81 deleted the sayers/timeouts branch November 28, 2023 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants