MCPcopy
hub / github.com/grpc/grpc-go / TestParseTimeOut

Method TestParseTimeOut

service_config_test.go:271–340  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

269}
270
271func (s) TestParseTimeOut(t *testing.T) {
272 testcases := []parseTestCase{
273 {
274 scjs: `{
275 "methodConfig": [
276 {
277 "name": [
278 {
279 "service": "foo",
280 "method": "Bar"
281 }
282 ],
283 "timeout": "1s"
284 }
285 ]
286}`,
287 wantSC: &ServiceConfig{
288 Methods: map[string]MethodConfig{
289 "/foo/Bar": {
290 Timeout: newDuration(time.Second),
291 },
292 },
293 lbConfig: lbConfigFor(t, "", nil),
294 },
295 },
296 {
297 scjs: `{
298 "methodConfig": [
299 {
300 "name": [
301 {
302 "service": "foo",
303 "method": "Bar"
304 }
305 ],
306 "timeout": "3c"
307 }
308 ]
309}`,
310 wantErr: true,
311 },
312 {
313 scjs: `{
314 "methodConfig": [
315 {
316 "name": [
317 {
318 "service": "foo",
319 "method": "Bar"
320 }
321 ],
322 "timeout": "3c"
323 },
324 {
325 "name": [
326 {
327 "service": "foo",
328 "method": "Bar"

Callers

nothing calls this directly

Calls 3

newDurationFunction · 0.85
lbConfigForFunction · 0.85
runParseTestsFunction · 0.85

Tested by

no test coverage detected