Skip to content

ECR credentials provider in k8schain makes revision reconciler tests slow #10878

@julz

Description

@julz

/area API

Describe the feature

When iterating on tests in reconciler/revision I noticed they take 10+ seconds to run. The main culprit seems to be TestResolve() which (via Resolve()) creates a k8schain to test resolving digests. Unfortunately this code iterates all the credential providers to auto-detect what to use and the ECR provider, at least on my computer, takes ages to fail :(.

Passing --tags disable_aws to disable that provider drops the test from seconds to milliseconds, but I doubt many people will guess to do this (and they shouldn't have to). There may be some other magic way to disable ECR from k8schain, but because it gets loaded implicitly via init if the file isn't excluded via build tags I couldn't find anything obvious.

An easy workaround for now may be to just move resolve*.go to its own subpackage, which is probably a worthwhile refactor anyway so I'll probably look at doing that if no-one hates the idea for any reason. Or maybe we should just disable the test in --short mode 🤷.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/APIAPI objects and controllerskind/featureWell-understood/specified features, ready for coding.triage/acceptedIssues which should be fixed (post-triage)

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions