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

Make slog test setup more robust #9194

Merged
merged 1 commit into from Aug 23, 2019
Merged

Make slog test setup more robust #9194

merged 1 commit into from Aug 23, 2019

Conversation

ghost
Copy link

@ghost ghost commented Aug 21, 2019

Motivation and Context

The slog tests fail when attempting to create pools using file vdevs that already exist from previous test runs.

Description

Remove existing vdev files from previous runs in the setup for the slog tests.

How Has This Been Tested?

Run the slog tests, abort in the middle of the run, run again.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (a change to man pages or other documentation)

Checklist:

Copy link
Contributor

@behlendorf behlendorf left a comment

Choose a reason for hiding this comment

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

Looks reasonable to me. Were you able to identify which tests failed to remove their file vdevs? If possible we should also update their cleanup functions to remove them on failure.

@behlendorf behlendorf added the Status: Code Review Needed Ready for review and testing label Aug 21, 2019
Copy link
Contributor

@ikozhukhov ikozhukhov left a comment

Choose a reason for hiding this comment

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

thanks for update.
i think, will be better try to remove unneeded files/dirs by test where we are using it instead of before new tests.
but by workaround this one will be fine too.

@ghost
Copy link
Author

ghost commented Aug 21, 2019

Actually, I think the preceding lines are where the problem was. It doesn't make sense to check if the devs are dirs. We can just remove them unconditionally.

@ghost
Copy link
Author

ghost commented Aug 21, 2019

@behlendorf Good idea, I can add that to the shared cleanup function as well and test it.

@ghost
Copy link
Author

ghost commented Aug 21, 2019

I've made each slog test responsible for its own setup and ensured they clean up after themselves better.

@ghost
Copy link
Author

ghost commented Aug 21, 2019

And to explain the motivation a little better, the cleanup wasn't running for us because something would deadlock and we'd have to reboot or reset the system. The next test run would then fail because of the files left by the interrupted run. Having the tests clean up these files beforehand seems to have been intended all along and is certainly helpful.

@behlendorf behlendorf requested a review from jwk404 August 21, 2019 21:36
@behlendorf
Copy link
Contributor

@freqlabs looks good, whenever you're ready can you drop the Requires-builders: style from the commit so we can get a full test run.

The slog tests fail when attempting to create pools using file vdevs
that already exist from previous test runs. Remove these files in the
setup for the test.

Signed-off-by: Ryan Moeller <ryan@ixsystems.com>
@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Aug 22, 2019
@codecov
Copy link

codecov bot commented Aug 22, 2019

Codecov Report

Merging #9194 into master will decrease coverage by 0.18%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9194      +/-   ##
==========================================
- Coverage   79.22%   79.03%   -0.19%     
==========================================
  Files         400      400              
  Lines      122001   122001              
==========================================
- Hits        96656    96429     -227     
- Misses      25345    25572     +227
Flag Coverage Δ
#kernel 79.7% <ø> (-0.05%) ⬇️
#user 66.7% <ø> (-0.34%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a9ebdfd...c1e88b2. Read the comment docs.

@behlendorf behlendorf merged commit 97c54ea into openzfs:master Aug 23, 2019
@ghost ghost deleted the slog-tests branch August 23, 2019 15:00
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Sep 18, 2019
The slog tests fail when attempting to create pools using file vdevs
that already exist from previous test runs. Remove these files in the
setup for the test.

Reviewed-by: Igor Kozhukhov <igor@dilos.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Signed-off-by: Ryan Moeller <ryan@ixsystems.com>
Closes openzfs#9194
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Sep 18, 2019
The slog tests fail when attempting to create pools using file vdevs
that already exist from previous test runs. Remove these files in the
setup for the test.

Reviewed-by: Igor Kozhukhov <igor@dilos.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Signed-off-by: Ryan Moeller <ryan@ixsystems.com>
Closes openzfs#9194
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Sep 23, 2019
The slog tests fail when attempting to create pools using file vdevs
that already exist from previous test runs. Remove these files in the
setup for the test.

Reviewed-by: Igor Kozhukhov <igor@dilos.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Signed-off-by: Ryan Moeller <ryan@ixsystems.com>
Closes openzfs#9194
tonyhutter pushed a commit that referenced this pull request Sep 26, 2019
The slog tests fail when attempting to create pools using file vdevs
that already exist from previous test runs. Remove these files in the
setup for the test.

Reviewed-by: Igor Kozhukhov <igor@dilos.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Signed-off-by: Ryan Moeller <ryan@ixsystems.com>
Closes #9194
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants