testing framework: implement panic handling (#33525)

This commit is contained in:
Liam Cervante 2023-07-19 09:57:09 +02:00 committed by GitHub
parent 837716a703
commit 2cc81cfec6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)
}()