@@ -73,6 +73,7 @@ func (s *Scenario) Run(ctx context.Context, t *testing.T) error {
7373 plugin := s .evalPlugins [idx ]
7474 pinfo := plugin .Info ()
7575 pretry := pinfo .Retry
76+ ptimeout := pinfo .Timeout
7677
7778 // Create a brand new context that inherits the top-level context's
7879 // cancel func. We want to set deadlines for each test spec and if
@@ -88,7 +89,7 @@ func (s *Scenario) Run(ctx context.Context, t *testing.T) error {
8889 time .Sleep (wait .BeforeDuration ())
8990 }
9091
91- to := getTimeout (ctx , sb .Timeout , scDefaults )
92+ to := getTimeout (ctx , sb .Timeout , ptimeout , scDefaults )
9293 if to != nil {
9394 var cancel context.CancelFunc
9495 specCtx , cancel = context .WithTimeout (specCtx , to .Duration ())
@@ -191,26 +192,36 @@ func (s *Scenario) Run(ctx context.Context, t *testing.T) error {
191192
192193// getTimeout returns the timeout value for the test spec. If the spec has a
193194// timeout override, we use that. Otherwise, we inspect the scenario's defaults
194- // and, if present, use that timeout.
195+ // and, if present, use that timeout. If the scenario's defaults for not
196+ // indicate a timeout configuration, we ask the plugin if it has timeout
197+ // defaults and use that.
195198func getTimeout (
196199 ctx context.Context ,
197200 specTimeout * gdttypes.Timeout ,
201+ pluginTimeout * gdttypes.Timeout ,
198202 scenDefaults * Defaults ,
199203) * gdttypes.Timeout {
200204 if specTimeout != nil {
201205 debug .Println (
202- ctx , "using timeout of %s (expected: %t) " ,
203- specTimeout .After , specTimeout . Expected ,
206+ ctx , "using timeout of %s" ,
207+ specTimeout .After ,
204208 )
205209 return specTimeout
206210 }
207211 if scenDefaults != nil && scenDefaults .Timeout != nil {
208212 debug .Println (
209- ctx , "using timeout of %s (expected: %t) [scenario default]" ,
210- scenDefaults .Timeout .After , scenDefaults . Timeout . Expected ,
213+ ctx , "using timeout of %s [scenario default]" ,
214+ scenDefaults .Timeout .After ,
211215 )
212216 return scenDefaults .Timeout
213217 }
218+ if pluginTimeout != nil {
219+ debug .Println (
220+ ctx , "using timeout of %s [plugin default]" ,
221+ pluginTimeout .After ,
222+ )
223+ return pluginTimeout
224+ }
214225 return nil
215226}
216227
0 commit comments