Skip to content

fix(logfiles): apply ignore rules to first search of a log file - #3580

Merged
mkoura merged 1 commit into
masterfrom
logfiles_first_search_expiry
Aug 3, 2026
Merged

fix(logfiles): apply ignore rules to first search of a log file#3580
mkoura merged 1 commit into
masterfrom
logfiles_first_search_expiry

Conversation

@mkoura

@mkoura mkoura commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

The ignore rules expiry for a log file without a recorded search state was evaluated against the current time instead of the recorded search timestamp. A rule with an expire time in the past was then not applied to the file, even though the whole unsearched file history may contain the ignored errors, and previously ignored errors surfaced as false failures. This contradicted the documented add_ignore_rule contract (a rule expires only when there are no yet to be searched log messages created before the expire time).

Use the recorded timestamp as is - a file that was not searched yet has timestamp 0.0, so no rule is expired for it.

Also fix a comment typo.

The ignore rules expiry for a log file without a recorded search state
was evaluated against the current time instead of the recorded search
timestamp. A rule with an expire time in the past was then not applied
to the file, even though the whole unsearched file history may contain
the ignored errors, and previously ignored errors surfaced as false
failures. This contradicted the documented add_ignore_rule contract
(a rule expires only when there are no yet to be searched log messages
created before the expire time).

Use the recorded timestamp as is - a file that was not searched yet has
timestamp 0.0, so no rule is expired for it.

Also fix a comment typo.
@mkoura
mkoura requested a review from saratomaz as a code owner August 3, 2026 10:30
@mkoura
mkoura requested review from Copilot and removed request for saratomaz August 3, 2026 10:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes ignore-rule expiry behavior during the first search of a log file in utils.logfiles, ensuring rules are evaluated against the recorded search timestamp (including 0.0 for “never searched yet”) rather than the current time. This aligns the implementation with the documented add_ignore_rule contract and prevents previously-ignored historical errors from resurfacing as false failures.

Changes:

  • Fix ignore-rule selection in search_cluster_logs() to use the recorded search timestamp as-is (so first search uses 0.0 and doesn’t prematurely expire rules).
  • Add a regression test covering “first search applies ignore rules even if skip_after is in the past; subsequent searches expire the rule”.
  • Fix a small comment typo in _search_log_lines’s signature comment.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
framework_tests/test_logfiles.py Adds a regression test to validate ignore-rule behavior on first vs. subsequent log searches.
cardano_node_tests/utils/logfiles.py Uses the recorded search timestamp (including 0.0) when applying ignore-rule expiry; fixes a comment typo.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mkoura
mkoura merged commit afd732b into master Aug 3, 2026
4 checks passed
@mkoura
mkoura deleted the logfiles_first_search_expiry branch August 3, 2026 10:35
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.

2 participants