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

Add zfs-test facility to automatically rerun failing tests #12740

Merged
merged 4 commits into from
Dec 1, 2021

Conversation

pcd1193182
Copy link
Contributor

@pcd1193182 pcd1193182 commented Nov 9, 2021

Motivation and Context

This was a project proposed as part of the Quality theme for the hackthon for the 2021 OpenZFS Developer Summit. The idea is to improve the usability of the automated tests that get run when a PR is created by having failing tests automatically rerun in order to make flaky tests less impactful.

Description

This started a port of the Illumos commit 13365 Add option to testrunner to re-run just failed tests. That commit contains the basic infrastructure in test-runner.py to filter a list of tests down to only include ones that failed in some previous logfile.

There are changes to zts-report.py.in to print the list of tests on the maybe list, which are the flaky ones. There's also the option to do the report as usual, but change the return code to a different value if all failures were on the maybe or known failure lists.

There are changes to zfs-tests.sh, which are what actually triggers rerunning the failing tests. If the rerun flag is passed, and the report indicates that all test failures were known failures or flaky tests, then we isolate the failed flaky tests and rerun them.

There are also changes to the github workflows to use the new option. This is a slightly different interface than the one they elected to use in Illumos; they added a -l flag that allows a logfile to be passed when you rerun the zfs-tests command. I elected to go with this approach as it was more ergonomic for the automation use case, though the -l option can also be added if needed.

How Has This Been Tested?

Local runs of zfs-test did automatically rerun the failing tests when the option was provided, and behaved as usual when it was omitted.

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)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

@pcd1193182 pcd1193182 requested review from behlendorf, jwk404 and a user November 9, 2021 23:49
@behlendorf behlendorf added Component: Test Suite Indicates an issue with the test framework or a test case Status: Code Review Needed Ready for review and testing labels Nov 9, 2021
@jwk404 jwk404 self-assigned this Nov 10, 2021
Copy link
Contributor

@tonynguien tonynguien left a comment

Choose a reason for hiding this comment

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

Looks good to me. Good stuff!

@jwk404 jwk404 merged commit 2320e6e into openzfs:master Dec 1, 2021
@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Dec 1, 2021
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Dec 6, 2021
This was a project proposed as part of the Quality theme for the
hackthon for the 2021 OpenZFS Developer Summit. The idea is to improve
the usability of the automated tests that get run when a PR is created
by having failing tests automatically rerun in order to make flaky
tests less impactful.

Reviewed-by: John Kennedy <[email protected]>
Reviewed-by: Tony Nguyen <[email protected]>
Signed-off-by: Paul Dagnelie <[email protected]>
Closes openzfs#12740
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Dec 6, 2021
This was a project proposed as part of the Quality theme for the
hackthon for the 2021 OpenZFS Developer Summit. The idea is to improve
the usability of the automated tests that get run when a PR is created
by having failing tests automatically rerun in order to make flaky
tests less impactful.

Reviewed-by: John Kennedy <[email protected]>
Reviewed-by: Tony Nguyen <[email protected]>
Signed-off-by: Paul Dagnelie <[email protected]>
Closes openzfs#12740
nicman23 pushed a commit to nicman23/zfs that referenced this pull request Aug 22, 2022
This was a project proposed as part of the Quality theme for the
hackthon for the 2021 OpenZFS Developer Summit. The idea is to improve
the usability of the automated tests that get run when a PR is created
by having failing tests automatically rerun in order to make flaky
tests less impactful.

Reviewed-by: John Kennedy <[email protected]>
Reviewed-by: Tony Nguyen <[email protected]>
Signed-off-by: Paul Dagnelie <[email protected]>
Closes openzfs#12740
nicman23 pushed a commit to nicman23/zfs that referenced this pull request Aug 22, 2022
This was a project proposed as part of the Quality theme for the
hackthon for the 2021 OpenZFS Developer Summit. The idea is to improve
the usability of the automated tests that get run when a PR is created
by having failing tests automatically rerun in order to make flaky
tests less impactful.

Reviewed-by: John Kennedy <[email protected]>
Reviewed-by: Tony Nguyen <[email protected]>
Signed-off-by: Paul Dagnelie <[email protected]>
Closes openzfs#12740
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Test Suite Indicates an issue with the test framework or a test case Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants