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

test: Fix test failure due to .coverage changing during tar creation. #557

Merged
merged 1 commit into from Nov 20, 2023

Conversation

smoser
Copy link
Contributor

@smoser smoser commented Nov 20, 2023

This seems to be a transient failure, but is legitimate issue.

When coverage binary is being used, this test case could fail with:

#  + mkdir /output
# + tar -cf /output/installer-iso.tar -C /stacker .
# tar: ./.coverage: file changed as we read it

The /stacker/.coverage file was being updated by the stacker binary itself. This is just a race condition based on when the file gets written to and when it was being collected by tar.

The change is just to only have tar collect the .cpio files.

What type of PR is this?

Which issue does this PR fix:

What does this PR do / Why do we need it:

If an issue # is not available please add repro steps and logs showing the issue:

Testing done on this change:

Automation added to e2e:

Will this break upgrades or downgrades?

Does this PR introduce any user-facing change?:


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link

codecov bot commented Nov 20, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (a34ebfa) 54.24% compared to head (045d32a) 5.72%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #557       +/-   ##
==========================================
- Coverage   54.24%   5.72%   -48.53%     
==========================================
  Files          64      64               
  Lines        7473    7473               
==========================================
- Hits         4054     428     -3626     
- Misses       2728    6982     +4254     
+ Partials      691      63      -628     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Makefile Outdated Show resolved Hide resolved
This seems to be a transient failure, but is legitimate issue.

When coverage binary is being used, this test case could fail with:

    #  + mkdir /output
    # + tar -cf /output/installer-iso.tar -C /stacker .
    # tar: ./.coverage: file changed as we read it

The /stacker/.coverage file was being updated by the stacker binary
itself.  This is just a race condition based on when the file gets
written to and when it was being collected by tar.

The change is just to only have tar collect the .cpio files.

Signed-off-by: Scott Moser <smoser@brickies.net>
Copy link
Contributor

@rchincha rchincha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@rchincha rchincha merged commit 236d70e into project-stacker:main Nov 20, 2023
9 of 11 checks passed
smoser added a commit to smoser/stacker that referenced this pull request Nov 20, 2023
I had a pull request (project-stacker#557) that changed a single line in a single
integration test.  c-i reported that coverage changed:
   5.72% (-48.53%) compared to a34ebfa
Where a34ebfa was the previous commit.

That doesn't sound right.  I think what is happening is that we have
multiple uploads of the coverage workflow and they're fighting.

There isn't any reason to upload both anyway.

Signed-off-by: Scott Moser <smoser@brickies.net>
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.

None yet

3 participants