Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
39b39d6c
Commit
39b39d6c
authored
9 years ago
by
Jan Tattermusch
Browse files
Options
Downloads
Patches
Plain Diff
implement timeout_on_sleeping_server interop test
parent
826f07eb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/csharp/Grpc.IntegrationTesting/InteropClient.cs
+26
-0
26 additions, 0 deletions
src/csharp/Grpc.IntegrationTesting/InteropClient.cs
src/csharp/Grpc.IntegrationTesting/InteropClientServerTest.cs
+6
-0
6 additions, 0 deletions
...csharp/Grpc.IntegrationTesting/InteropClientServerTest.cs
with
32 additions
and
0 deletions
src/csharp/Grpc.IntegrationTesting/InteropClient.cs
+
26
−
0
View file @
39b39d6c
...
@@ -169,6 +169,9 @@ namespace Grpc.IntegrationTesting
...
@@ -169,6 +169,9 @@ namespace Grpc.IntegrationTesting
case
"cancel_after_first_response"
:
case
"cancel_after_first_response"
:
await
RunCancelAfterFirstResponseAsync
(
client
);
await
RunCancelAfterFirstResponseAsync
(
client
);
break
;
break
;
case
"timeout_on_sleeping_server"
:
await
RunTimeoutOnSleepingServerAsync
(
client
);
break
;
case
"benchmark_empty_unary"
:
case
"benchmark_empty_unary"
:
RunBenchmarkEmptyUnary
(
client
);
RunBenchmarkEmptyUnary
(
client
);
break
;
break
;
...
@@ -458,6 +461,29 @@ namespace Grpc.IntegrationTesting
...
@@ -458,6 +461,29 @@ namespace Grpc.IntegrationTesting
Console
.
WriteLine
(
"Passed!"
);
Console
.
WriteLine
(
"Passed!"
);
}
}
public
static
async
Task
RunTimeoutOnSleepingServerAsync
(
TestService
.
ITestServiceClient
client
)
{
Console
.
WriteLine
(
"running timeout_on_sleeping_server"
);
var
deadline
=
DateTime
.
UtcNow
.
AddMilliseconds
(
1
);
using
(
var
call
=
client
.
FullDuplexCall
(
deadline
:
deadline
))
{
try
{
await
call
.
RequestStream
.
WriteAsync
(
StreamingOutputCallRequest
.
CreateBuilder
()
.
SetPayload
(
CreateZerosPayload
(
27182
)).
Build
());
}
catch
(
InvalidOperationException
)
{
// Deadline was reached before write has started. Eat the exception and continue.
}
var
ex
=
Assert
.
Throws
<
RpcException
>(
async
()
=>
await
call
.
ResponseStream
.
MoveNext
());
Assert
.
AreEqual
(
StatusCode
.
DeadlineExceeded
,
ex
.
Status
.
StatusCode
);
}
Console
.
WriteLine
(
"Passed!"
);
}
// This is not an official interop test, but it's useful.
// This is not an official interop test, but it's useful.
public
static
void
RunBenchmarkEmptyUnary
(
TestService
.
ITestServiceClient
client
)
public
static
void
RunBenchmarkEmptyUnary
(
TestService
.
ITestServiceClient
client
)
{
{
...
...
This diff is collapsed.
Click to expand it.
src/csharp/Grpc.IntegrationTesting/InteropClientServerTest.cs
+
6
−
0
View file @
39b39d6c
...
@@ -127,5 +127,11 @@ namespace Grpc.IntegrationTesting
...
@@ -127,5 +127,11 @@ namespace Grpc.IntegrationTesting
{
{
await
InteropClient
.
RunCancelAfterFirstResponseAsync
(
client
);
await
InteropClient
.
RunCancelAfterFirstResponseAsync
(
client
);
}
}
[
Test
]
public
async
Task
TimeoutOnSleepingServerAsync
()
{
await
InteropClient
.
RunTimeoutOnSleepingServerAsync
(
client
);
}
}
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment