File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,8 @@ import (
3333 "google.golang.org/protobuf/types/known/durationpb"
3434)
3535
36+ const defaultTestTimeout = 10 * time .Second
37+
3638func (s ) TestLog (t * testing.T ) {
3739 idGen .reset ()
3840 ml := NewTruncatingMethodLogger (10 , 10 )
@@ -336,7 +338,9 @@ func (s) TestLog(t *testing.T) {
336338 for i , tc := range testCases {
337339 buf .Reset ()
338340 tc .want .SequenceIdWithinCall = uint64 (i + 1 )
339- ml .Log (context .Background (), tc .config )
341+ ctx , cancel := context .WithTimeout (context .Background (), defaultTestTimeout )
342+ defer cancel ()
343+ ml .Log (ctx , tc .config )
340344 inSink := new (binlogpb.GrpcLogEntry )
341345 if err := proto .Unmarshal (buf .Bytes ()[4 :], inSink ); err != nil {
342346 t .Errorf ("failed to unmarshal bytes in sink to proto: %v" , err )
You can’t perform that action at this time.
0 commit comments