This commit is contained in:
20
vendor/google.golang.org/grpc/internal/internal.go
generated
vendored
20
vendor/google.golang.org/grpc/internal/internal.go
generated
vendored
@ -259,6 +259,20 @@ var (
|
||||
// SetBufferPoolingThresholdForTesting updates the buffer pooling threshold, for
|
||||
// testing purposes.
|
||||
SetBufferPoolingThresholdForTesting any // func(int)
|
||||
|
||||
// TimeAfterFunc is used to create timers. During tests the function is
|
||||
// replaced to track allocated timers and fail the test if a timer isn't
|
||||
// cancelled.
|
||||
TimeAfterFunc = func(d time.Duration, f func()) Timer {
|
||||
return time.AfterFunc(d, f)
|
||||
}
|
||||
|
||||
// NewStreamWaitingForResolver is a test hook that is triggered when a
|
||||
// new stream blocks while waiting for name resolution. This can be
|
||||
// used in tests to synchronize resolver updates and avoid race conditions.
|
||||
// When set, the function will be called before the stream enters
|
||||
// the blocking state.
|
||||
NewStreamWaitingForResolver = func() {}
|
||||
)
|
||||
|
||||
// HealthChecker defines the signature of the client-side LB channel health
|
||||
@ -300,3 +314,9 @@ type EnforceSubConnEmbedding interface {
|
||||
type EnforceClientConnEmbedding interface {
|
||||
enforceClientConnEmbedding()
|
||||
}
|
||||
|
||||
// Timer is an interface to allow injecting different time.Timer implementations
|
||||
// during tests.
|
||||
type Timer interface {
|
||||
Stop() bool
|
||||
}
|
||||
|
Reference in New Issue
Block a user