Skip to content

[bugfix] Treat correctly failed_stage=None in failure stats report #3454

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

Merged
merged 2 commits into from
Apr 8, 2025

Conversation

xinye-hpe
Copy link
Contributor

@xinye-hpe xinye-hpe commented Apr 7, 2025

This PR tries to address the following error when using the --failure-stats command line option

ERROR: run session stopped: type error: unsupported format string passed to NoneType.__format__
ERROR: Traceback (most recent call last):
  File "/hpcdc/project/scilib/libsci_acc/csml-libsci-acc-testing/python-libs/x86_64/python3.11/site-packages/reframe/frontend/cli.py", line 1654, in main
    printer.failure_stats(
  File "/hpcdc/project/scilib/libsci_acc/csml-libsci-acc-testing/python-libs/x86_64/python3.11/site-packages/reframe/frontend/printer.py", line 227, in failure_stats
    stats_body.append(row_format.format(p, len(l), l[0]))
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: unsupported format string passed to NoneType.__format__

The problem is that successful tests are stored with tc['fail_phase'] as None and also got passed to the dictionary failures. Then later when ReFrame tries to generate a report, p is set to None in the following lines

for p, l in failures.items():
    stats_body.append(row_format.format(p, len(l), l[0]))

You can reproduce the same behavior with

$ python -c '"{:<13}".format(None)'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
TypeError: unsupported format string passed to NoneType.__format__

Copy link
Contributor

@vkarak vkarak left a comment

Choose a reason for hiding this comment

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

Thanks! I have just a minor style comment.

@github-project-automation github-project-automation bot moved this from Todo to In Progress in ReFrame Backlog Apr 7, 2025
@vkarak vkarak changed the title [bugfix] Fix bug where failed_stage can be None in failure stats report [bugfix] Treat correctly failed_stage=None in failure stats report Apr 8, 2025
@vkarak vkarak merged commit 64f6338 into reframe-hpc:master Apr 8, 2025
36 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in ReFrame Backlog Apr 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants