From 2cc81cfec69920032f7a9340b11eacfae752724c Mon Sep 17 00:00:00 2001 From: Liam Cervante Date: Wed, 19 Jul 2023 09:57:09 +0200 Subject: [PATCH] testing framework: implement panic handling (#33525) --- internal/command/test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/command/test.go b/internal/command/test.go index c9ea6c29f0..111790c069 100644 --- a/internal/command/test.go +++ b/internal/command/test.go @@ -396,6 +396,7 @@ func (runner *TestRunner) execute(run *moduletest.Run, file *moduletest.File, co var plan *plans.Plan var planDiags tfdiags.Diagnostics go func() { + defer logging.PanicHandler() defer done() plan, planDiags = tfCtx.Plan(config, state, opts) }() @@ -442,6 +443,7 @@ func (runner *TestRunner) execute(run *moduletest.Run, file *moduletest.File, co var applyDiags tfdiags.Diagnostics go func() { + defer logging.PanicHandler() defer done() updated, applyDiags = tfCtx.Apply(plan, config) }()