Skip to content

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

Open

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 🤷.

Activity

  1. added
    kind/feature
    on Mar 3, 2021
  2. added
    area/API
    on Mar 3, 2021
  3. dprotaso commented on Mar 3, 2021

    @dprotaso
    Member

    quick question: are you on VPN or anything?

  4. markusthoemmes commented on Mar 3, 2021

    @markusthoemmes
    Contributor

    VPN has nothing to do with it, I have the same RCA on my todo list to fix. Thanks for writing it up @julz.

    For more context: I've once traced the slowness down to a call against the EC2 service that's just really slow. See https://kubernetes.slack.com/archives/C0LRMHZ1T/p1610643195004300

  5. evankanderson commented on Mar 15, 2021

    @evankanderson
    Member

    /assign @markusthoemmes
    /triage accepted

  6. added
    triage/accepted
    on Mar 15, 2021
  7. added this to the Ice Box milestone on Jun 12, 2021
  8. markusthoemmes commented on Dec 3, 2021

    @markusthoemmes
    Contributor

    /unassign

    Not working on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/APIkind/featuretriage/accepted

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions