diff --git a/internal/build/imgsrc/ensure_builder.go b/internal/build/imgsrc/ensure_builder.go index 3f9f47b230..d993a78b39 100644 --- a/internal/build/imgsrc/ensure_builder.go +++ b/internal/build/imgsrc/ensure_builder.go @@ -15,8 +15,6 @@ import ( "github.com/superfly/flyctl/internal/flyutil" "github.com/superfly/flyctl/internal/haikunator" "github.com/superfly/flyctl/internal/tracing" - "go.opentelemetry.io/otel/attribute" - "go.opentelemetry.io/otel/trace" ) func EnsureBuilder(ctx context.Context, org *fly.Organization, region string, recreateBuilder bool) (*fly.Machine, *fly.App, error) { @@ -148,7 +146,7 @@ const ( ) func validateBuilder(ctx context.Context, app *fly.App) (*fly.Machine, error) { - ctx, span := tracing.GetTracer().Start(ctx, "validate_builder", trace.WithAttributes(attribute.String("bulder_app", app.Name))) + ctx, span := tracing.GetTracer().Start(ctx, "validate_builder") defer span.End() if app == nil { diff --git a/internal/build/imgsrc/ensure_builder_test.go b/internal/build/imgsrc/ensure_builder_test.go index de658952ce..c07e96d943 100644 --- a/internal/build/imgsrc/ensure_builder_test.go +++ b/internal/build/imgsrc/ensure_builder_test.go @@ -265,34 +265,23 @@ func TestRestartBuilderMachine(t *testing.T) { ctx := context.Background() couldNotReserveResources := false - waitedForStartOrStop := false flapsClient := mock.FlapsClient{ - RestartFunc: func(ctx context.Context, input fly.RestartMachineInput, nonce string) error { + StartFunc: func(ctx context.Context, machineID string, nonce string) (*fly.MachineStartResponse, error) { if couldNotReserveResources { - return &flaps.FlapsError{ + return nil, &flaps.FlapsError{ OriginalError: fmt.Errorf("failed to restart VM xyzabc: unknown: could not reserve resource for machine: insufficient memory available to fulfill request"), } } - return nil - }, - WaitFunc: func(ctx context.Context, machine *fly.Machine, state string, timeout time.Duration) (err error) { - if state == "started" || state == "stopped" { - waitedForStartOrStop = true - } - - return nil + return nil, nil }, } ctx = flapsutil.NewContextWithClient(ctx, &flapsClient) err := startBuilder(ctx, &fly.Machine{ID: "bigmachine"}) assert.NoError(t, err) - assert.True(t, waitedForStartOrStop) - waitedForStartOrStop = false couldNotReserveResources = true err = startBuilder(ctx, &fly.Machine{ID: "bigmachine"}) - assert.True(t, waitedForStartOrStop) assert.Error(t, err) assert.ErrorIs(t, err, ShouldReplaceBuilderMachine)