Coder Social home page Coder Social logo

Comments (2)

Frassle avatar Frassle commented on August 20, 2024

Got a slightly different stack trace:

panic: expected message "hello world!" not equal to actual message ""
    goroutine 45 [running]:
    main.main.func1.1(***0xc000171230?, 0x2?, 0x0?***)
    	/home/runner/go/src/stackName-1721331326864178436-827910/main.go:138 +0x16e
    reflect.Value.call(***0xcf58e0?, 0xee06b8?, 0x30?***, ***0xe744e7, 0x4***, ***0xc000600bd0, 0x1, 0xc000526878?***)
    	/opt/hostedtoolcache/go/1.22.5/x64/src/reflect/value.go:596 +0xca6
    reflect.Value.Call(***0xcf58e0?, 0xee06b8?, 0x101000000000000?***, ***0xc000600bd0?, 0x0?, 0x3?***)
    	/opt/hostedtoolcache/go/1.22.5/x64/src/reflect/value.go:380 +0xb9
    github.com/pulumi/pulumi/sdk/v3/go/internal.(*applier).Call(0xc000529940, ***0xfcf570, 0x17480c0***, ***0xca67a0?, 0xc0004bc570?, 0x0?***)
    	/home/runner/work/pulumi/pulumi/sdk/go/internal/types.go:510 +0x22d
    github.com/pulumi/pulumi/sdk/v3/go/internal.(*OutputState).applyTWithApplier.func1()
    	/home/runner/work/pulumi/pulumi/sdk/go/internal/types.go:622 +0x16a
    created by github.com/pulumi/pulumi/sdk/v3/go/internal.(*OutputState).applyTWithApplier in goroutine 1
    	/home/runner/work/pulumi/pulumi/sdk/go/internal/types.go:609 +0x265

from pulumi.

tgummerer avatar tgummerer commented on August 20, 2024

I just realized the NodeJS version of this test is flaky as well (#11677), probably for the same reasons.

The problem here is that RegisterResourceOutputs is run in a Goroutine/async in NodeJS. This means the registration of the resource output might not complete before we try to access the child resource. But because of how resource registration works, we might already have registered a nil value for that field. Thus the UnsafeAwait/pulumi.All don't wait any longer, because the RegisterResourceOutputs might not even have started at this point.

This can easily be reproduced using the following diff:

diff --git a/sdk/go/pulumi/context.go b/sdk/go/pulumi/context.go
index e4a75dd7b8..f15b276e5b 100644
--- a/sdk/go/pulumi/context.go
+++ b/sdk/go/pulumi/context.go
@@ -29,6 +29,7 @@ import (
        "sort"
        "strings"
        "sync"
+       "time"
 
        multierror "github.com/hashicorp/go-multierror"
        "github.com/pulumi/pulumi/sdk/v3/go/common/resource"
@@ -2191,6 +2195,7 @@ func (ctx *Context) RegisterResourceOutputs(resource Resource, outs Map) error {
        }
 
        go func() {
+               time.Sleep(5 * time.Second)
                // No matter the outcome, make sure all promises are resolved and that we've signaled completion of this RPC.
                var err error
                defer func() {

from pulumi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.