From f09ca32c3981a13b0901be59b7f02cd36152337d Mon Sep 17 00:00:00 2001 From: Matthew Jeffryes Date: Thu, 19 Jun 2025 07:42:06 -0700 Subject: [PATCH] Report partial errors --- pkg/modprovider/module.go | 11 ++--------- tests/acc_test.go | 2 -- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/pkg/modprovider/module.go b/pkg/modprovider/module.go index dd578c03..2c2e5462 100644 --- a/pkg/modprovider/module.go +++ b/pkg/modprovider/module.go @@ -278,15 +278,8 @@ func (h *moduleHandler) applyModuleOperation( } if applyErr != nil { - // TODO[pulumi/pulumi-terraform-module#342] Possibly wrap partial errors in initializationError. This - // does not quite work as expected yet as views get recorded into state as pending_operations. They - // need to be recorded as finalized operations because they did complete. - if 1+2 == 4 { - applyErr = h.initializationError(moduleOutputs, applyErr.Error()) - } - - // Instead, log and propagate the error for now. This will forget partial TF state but fail Pulumi. - logger.Log(ctx, tfsandbox.Error, fmt.Sprintf("partial failure in apply: %v", applyErr)) + // we have a partial error, wrap it with ErrorResourceInitFailed + applyErr = h.initializationError(moduleOutputs, applyErr.Error()) } return moduleOutputs, views, applyErr diff --git a/tests/acc_test.go b/tests/acc_test.go index 4573a9e7..ea139eaf 100644 --- a/tests/acc_test.go +++ b/tests/acc_test.go @@ -245,8 +245,6 @@ func TestLambdaMemorySizeDiff(t *testing.T) { func TestPartialApply(t *testing.T) { t.Parallel() - t.Skip("TODO[pulumi/pulumi#19635]") - var debugOpts debug.LoggingOptions // To enable debug logging in this test, un-comment: