Skip to content

Conversation

@wking
Copy link
Contributor

@wking wking commented May 11, 2019

In 1c0fb51 (#593), I changed the test data for this test from:

makeTestAuthConfig(testAuthConfigDataMap{
  "docker.io":      testAuthConfigData{"user", "pw"},
  "localhost:5000": testAuthConfigData{"joe", "pass"},
})

to the full.json fixture which includes:

{
  "auths": {
    "example.org": {
      "auth": "ZXhhbXBsZTpvcmc="
    },
    "index.docker.io": {
      "auth": "aW5kZXg6ZG9ja2VyLmlv"
    },
    "docker.io": {
      "auth": "ZG9ja2VyOmlv"
    },
    ...
  }
}

That lead ordering instability matching the normalized docker.io, with it occasionally matching the expected docker.io entry, and occasionally matching the index.docker.io entry. With this commit, I'm adjusting the hostname to be based on example.org to avoid such ambiguity in target matching while still excercising all the normalization logic that was being excercised before 1c0fb51.

In 1c0fb51 (pkg/docker/config/testdata: Add credential-file
fixtures, 2019-02-28, containers#593), I changed the test data for this test
from:

  makeTestAuthConfig(testAuthConfigDataMap{
    "docker.io":      testAuthConfigData{"user", "pw"},
    "localhost:5000": testAuthConfigData{"joe", "pass"},
  })

to the full.json fixture which includes:

  {
    "auths": {
      "example.org": {
        "auth": "ZXhhbXBsZTpvcmc="
      },
      "index.docker.io": {
        "auth": "aW5kZXg6ZG9ja2VyLmlv"
      },
      "docker.io": {
        "auth": "ZG9ja2VyOmlv"
      },
      ...
    }
  }

That lead ordering instability matching the normalized docker.io, with
it occasionally matching the expected docker.io entry, and
occasionally matching the index.docker.io entry.  With this commit,
I'm adjusting the hostname to be based on example.org to avoid such
ambiguity in target matching while still excercising all the
normalization logic that was being excercised before 1c0fb51.

Signed-off-by: W. Trevor King <wking@tremily.us>
@wking
Copy link
Contributor Author

wking commented May 11, 2019

Checking for flake-fixing-ness:

$ go test -count 100 ./pkg/docker/config
ok  	github.com/containers/image/pkg/docker/config	0.377s

@mtrmac
Copy link
Collaborator

mtrmac commented May 13, 2019

@vrothberg PTAL; consider also #624.

(This fix seems correct to me, FWIW.)

@vrothberg
Copy link
Member

LGTM 👍 I'll shamelessly click on Update branch, so we can merge it if everybody is on the same page. Thanks, @wking and @mtrmac!

@rhatdan rhatdan merged commit 1abdd5f into containers:master May 14, 2019
@wking wking deleted the normalize-registry-test-flake branch May 15, 2019 01:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants