Skip to content

Conversation

@GernotMaier
Copy link
Contributor

@GernotMaier GernotMaier commented Aug 27, 2025

This is an interesting issue. The integration tests for all simulate-prod steps are failing for the CORSIKA 7.8... containers.

The failing is in the log-file testing module which searches the log files for the following patterns:

ERROR_PATTERNS = [
    re.compile(r"error", re.IGNORECASE),
    re.compile(r"exception", re.IGNORECASE),
    re.compile(r"traceback", re.IGNORECASE),
    re.compile(r"\b(failed to|has failed)\b", re.IGNORECASE),
    re.compile(r"runtime\s*warning", re.IGNORECASE),
    re.compile(r"segmentation fault", re.IGNORECASE),
]

No for some reason there is a non-UTF8 pattern in the metadata. We had considered this when reading the metadata in simtools.simtel.simtel_io_metadata and handle this correctly. Unfortunately, the warning has a "Failed to..." in the warning text, triggering above ERROR_PATTERNS.

As this is safe, and 'Failed to...' is too strong for a simple warning, I changed the warning text to "Unable to...".

Additionally to above, an IGNORE_PATTERN is introduced to allow certain messages (as this problematic one) in the log file. I am aware that this is a bit of fine tuning, but this should be ok (there will be more: hard to control the error and warning messages from all the external software we are using).

Works, see https://github.com/gammasim/simtools/actions/runs/17268513488

(generally a bit puzzling; I was trying to reproduce it locally and don't get this warning)

Closes #1711

@GernotMaier GernotMaier requested a review from Copilot August 27, 2025 11:59
@GernotMaier GernotMaier self-assigned this Aug 27, 2025
Copy link
Contributor

Copilot AI left a comment

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 addresses a specific issue with integration tests failing for CORSIKA 7.8 containers due to overly aggressive error pattern matching in log files. The core problem was that a warning message containing "Failed to..." was triggering error detection patterns, causing tests to fail unnecessarily.

  • Changed warning message text from "Failed to decode metadata..." to "Unable to decode metadata..." to avoid triggering error patterns
  • Updated corresponding test assertion to match the new warning message text

Reviewed Changes

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

File Description
src/simtools/simtel/simtel_io_metadata.py Modified warning message to use "Unable to" instead of "Failed to" when metadata decoding fails
tests/unit_tests/simtel/test_simtel_io_metadata.py Updated test assertion to match the new warning message text

@codecov
Copy link

codecov bot commented Aug 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.03%. Comparing base (ab56e74) to head (150e12b).
⚠️ Report is 27 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1712      +/-   ##
==========================================
- Coverage   98.03%   98.03%   -0.01%     
==========================================
  Files          90       90              
  Lines       11794    11787       -7     
==========================================
- Hits        11562    11555       -7     
  Misses        232      232              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ctao-sonarqube
Copy link

@GernotMaier GernotMaier marked this pull request as ready for review August 27, 2025 14:31
Copy link
Collaborator

@EshitaJoshi EshitaJoshi 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 the PR!

@GernotMaier
Copy link
Contributor Author

Again thank you @EshitaJoshi

@GernotMaier GernotMaier merged commit 8ef4eb2 into main Aug 28, 2025
18 checks passed
@GernotMaier GernotMaier deleted the corsika-78-failed-integration-tests branch August 28, 2025 14:25
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.

Tests failing in corsika 7.800 containers

3 participants