Skip to content

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

Merged
vkarak merged 2 commits intoreframe-hpc:masterfrom
xinye-hpe:bugfix/failure-stat
Apr 8, 2025
Merged

[bugfix] Treat correctly failed_stage=None in failure stats report#3454
vkarak merged 2 commits intoreframe-hpc:masterfrom
xinye-hpe:bugfix/failure-stat

Conversation

@xinye-hpe
Copy link
Copy Markdown
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
Copy Markdown
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