Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flaky Test - TestDocker (a packaging test) fails validating exported images #37726

Closed
andrewkroh opened this issue Jan 24, 2024 · 2 comments · Fixed by #37727
Closed

Flaky Test - TestDocker (a packaging test) fails validating exported images #37726

andrewkroh opened this issue Jan 24, 2024 · 2 comments · Fixed by #37727
Labels
flaky-test Unstable or unreliable test cases. :Packaging Packaging Team:Elastic-Agent Label for the Agent team

Comments

@andrewkroh
Copy link
Member

andrewkroh commented Jan 24, 2024

Flaky Test

  • Test Name: TestDocker
  • Link:
    case strings.HasSuffix(header.Name, ".json") && header.Name != "manifest.json":
    info, err = readDockerInfo(tarReader)
    if err != nil {
    return nil, nil, err
    }
  • Branch: main
  • Artifact Link: If available, attach the generated zip artifact associated with the stack trace for this failure.
  • Notes: The docker engine version being used on CI has changed to export images in the OCI Image Layout. Our test is expecting to find a JSON file in the root of the image, but that is now moved into a blobs/sha256/<layer> where the path is determined by reading jq '.[].Config manifest.json'.

Stack Trace

>> Testing package contents
 --- FAIL: TestDocker (2.82s)
     package_test.go:234: error reading file /var/lib/jenkins/workspace/Beats_packaging_main/src/github.com/elastic/beats/metricbeat/build/distributions/metricbeat-oss-8.13.0-SNAPSHOT-linux-amd64.docker.tar.gz: no entrypoint
 FAIL
 FAIL	command-line-arguments	9.253s
 FAIL
 package ran for 10m34.012428251s
 Error: running "go test /var/lib/jenkins/workspace/Beats_packaging_main/src/github.com/elastic/beats/dev-tools/packaging/package_test.go --modules --min-modules 1 --modules.d -root-owner -files /var/lib/jenkins/workspace/Beats_packaging_main/src/github.com/elastic/beats/metricbeat/build/distributions/*" failed with exit code 1

@andrewkroh andrewkroh added :Packaging Packaging flaky-test Unstable or unreliable test cases. labels Jan 24, 2024
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jan 24, 2024
@pierrehilbert pierrehilbert added the Team:Elastic-Agent Label for the Agent team label Jan 24, 2024
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jan 24, 2024
@cmacknz
Copy link
Member

cmacknz commented Jan 24, 2024

Thanks, we need to update this check to handle both formats. As we have just learned, Beats itself isn't in control of when the format can change.

andrewkroh added a commit to andrewkroh/beats that referenced this issue Jan 24, 2024
Modify TestDocker such that is can read both the original docker image layout and the OCI Image Layout.
This works by reading the config and layer file names from the manifest.yml instead of assuming their names.

Fixes elastic#37726
@andrewkroh
Copy link
Member Author

Potential fix: #37727

andrewkroh added a commit to andrewkroh/beats that referenced this issue Jan 24, 2024
Modify TestDocker such that is can read both the original docker image layout and the OCI Image Layout.
This works by reading the config and layer file names from the manifest.yml instead of assuming their names.

Fixes elastic#37726
andrewkroh added a commit that referenced this issue Jan 24, 2024
Modify TestDocker such that is can read both the original docker image layout and the OCI Image Layout.
This works by reading the config and layer file names from the manifest.yml instead of assuming their names.

Fixes #37726
mergify bot pushed a commit that referenced this issue Jan 24, 2024
Modify TestDocker such that is can read both the original docker image layout and the OCI Image Layout.
This works by reading the config and layer file names from the manifest.yml instead of assuming their names.

Fixes #37726

(cherry picked from commit ebd8512)
mergify bot pushed a commit that referenced this issue Jan 24, 2024
Modify TestDocker such that is can read both the original docker image layout and the OCI Image Layout.
This works by reading the config and layer file names from the manifest.yml instead of assuming their names.

Fixes #37726

(cherry picked from commit ebd8512)
andrewkroh added a commit that referenced this issue Jan 24, 2024
Modify TestDocker such that is can read both the original docker image layout and the OCI Image Layout.
This works by reading the config and layer file names from the manifest.yml instead of assuming their names.

Fixes #37726

(cherry picked from commit ebd8512)

Co-authored-by: Andrew Kroh <[email protected]>
andrewkroh pushed a commit that referenced this issue Jan 25, 2024
…37730)

* package_test.go - Support OCI Image Layout (#37727)

Modify TestDocker such that is can read both the original docker image layout and the OCI Image Layout.
This works by reading the config and layer file names from the manifest.yml instead of assuming their names.

Fixes #37726

(cherry picked from commit ebd8512)

* Replace slices.Contains usage with helper func

The 8.12 branch is not yet on Go 1.21 so the slices package isn't available.
Scholar-Li pushed a commit to Scholar-Li/beats that referenced this issue Feb 5, 2024
Modify TestDocker such that is can read both the original docker image layout and the OCI Image Layout.
This works by reading the config and layer file names from the manifest.yml instead of assuming their names.

Fixes elastic#37726
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flaky-test Unstable or unreliable test cases. :Packaging Packaging Team:Elastic-Agent Label for the Agent team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants