Atlas › Test

timeout_specified

Exact test identity: go.temporal.io/server/common/contextutil/TestWithDeadlineBuffer/parent_has_no_deadline/timeout_specified

Package
go.temporal.io/server/common/contextutil
Suite / test hierarchy
TestWithDeadlineBuffer/parent_has_no_deadline/timeout_specified
Test
timeout_specified
Introduced at
deadline.go ×1 Frontier kind: Joint frontier
Covered ranges
3
Covered lines
8
Covered files
1

Covered source

Expand a file to inspect source; the > gutter marks covered lines.

go.temporal.io/server/common/contextutil/deadline.go 8 covered LOC · 3 ranges

Open complete file

18 timeout time.Duration,
19 buffer time.Duration,
20 > ) (context.Context, context.CancelFunc) { deadline.go
21 > if parent.Err() != nil {
22 return parent, noop
23 }
24
25 > parentDeadline, parentHasDeadline := parent.Deadline() deadline.go
26 >
27 > if !parentHasDeadline {
28 > // No parent deadline, so buffer is available to parent after child deadline expiry. deadline.go
29 > return context.WithTimeout(parent, timeout)
30 > }
31
32 // If parent deadline itself does not allow buffer then set child timeout to zero. Otherwise