-
Notifications
You must be signed in to change notification settings - Fork 308
Add --skip-known-failures flag for smart rerun filtering #2094
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| Known Failure Patterns | ||
| ====================== | ||
|
|
||
| When using the ``--skip-known-failures`` option with ``teuthology-suite --rerun``, | ||
| teuthology can filter out jobs with known failure patterns. The known patterns are | ||
| loaded from a JSON or YAML file specified with ``--known-failure-patterns``, or from | ||
| the default bundled file ``teuthology/suite/patterns/known-failures.json``. | ||
|
|
||
| File Format | ||
| ----------- | ||
|
|
||
| The file format supports both JSON and YAML. The file must contain a ``patterns`` | ||
| key with a list of regex patterns (strings) that will be matched against job | ||
| failure reasons. | ||
|
|
||
| JSON format example:: | ||
|
|
||
| { | ||
| "patterns": [ | ||
| "Command failed on .* with status 1:", | ||
| "clocks not synchronized", | ||
| "cluster \\[WRN\\] Health check failed:.*OBJECT_UNFOUND" | ||
| ] | ||
| } | ||
|
|
||
| YAML format example:: | ||
|
|
||
| patterns: | ||
| - "Command failed on .* with status 1:" | ||
| - "clocks not synchronized" | ||
| - "cluster \\[WRN\\] Health check failed:.*OBJECT_UNFOUND" | ||
|
|
||
| Pattern Matching | ||
| ---------------- | ||
|
|
||
| Patterns are matched using Python's ``re.search()`` function, so they support | ||
| full regular expression syntax. If a job's ``failure_reason`` matches any of | ||
| the patterns, it is considered a known failure and will be skipped during | ||
| rerun when ``--skip-known-failures`` is enabled. | ||
|
|
||
| Only jobs with failure reasons that don't match any known pattern will be | ||
| scheduled for rerun. | ||
|
|
||
| Usage | ||
| ----- | ||
|
|
||
| To use known failure patterns during rerun:: | ||
|
|
||
| teuthology-suite --rerun <run_name> --skip-known-failures | ||
|
|
||
| To specify a custom patterns file:: | ||
|
|
||
| teuthology-suite --rerun <run_name> --skip-known-failures --known-failure-patterns /path/to/patterns.json | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file should not be located in the root of teuthology, but better to put it in the related directory. Isn't it better to put it to
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, the format of the patterns should be documented somewhere in |
||
| "patterns": [ | ||
| "Command failed on .* with status 1:", | ||
| "clocks not synchronized", | ||
| "cluster \\[WRN\\] Health check failed: 575/44578 objects unfound \\(1\\.290%\\) \\(OBJECT_UNFOUND\\)" | ||
| ] | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, but look, do you really want to always provide custom pattern file as an argument, or maybe it would be great to fix it in teuthology config file or possible via environment variable. If so, then we do not need to import _get_default_known_failure_patterns_file directly, and get using
defaultsor get it from theconfig.