Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions toolchain/mfc/test/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,11 +611,7 @@ def handle_case(case: TestCase, devices: typing.Set[int]):
cons.print(f" UUID: [magenta]{case.get_uuid()}[/magenta]")
cons.print(f" Attempts: {nAttempts}")

# Show truncated error message
exc_str = str(exc)
if len(exc_str) > 300:
exc_str = exc_str[:297] + "..."
cons.print(f" Error: {exc_str}")
cons.print(f" Error: {exc}")
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.

Action required

1. Markup-parsed error crashes 🐞 Bug ☼ Reliability

In handle_case, the exception message is printed through Rich with markup parsing enabled, so
exception strings containing [/] can be interpreted as markup and raise a Rich rendering error
while reporting the failure. This can interrupt the test runner’s failure reporting and hide the
original test error.
Agent Prompt
## Issue description
`handle_case` prints exception text via Rich markup parsing. If the exception message contains `[` / `]` sequences, Rich may interpret them as markup and raise during printing, masking the original test failure.

## Issue Context
The printer wrapper uses `rich.console.Console()` and forwards strings to `Console.print()` without escaping, so markup parsing is on by default.

## Fix Focus Areas
- toolchain/mfc/test/test.py[609-616]
- toolchain/mfc/printer.py[7-40]

## Suggested change
Print the error line with markup disabled (or escape the exception text). For example:
- `cons.print(f"    Error: {exc}", markup=False)`

Optionally preserve formatting for your own exceptions only:
- `cons.print(f"    Error: {exc}", markup=isinstance(exc, MFCException))`
(or escape only when not an `MFCException`).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


# Provide helpful hints based on error type
exc_lower = str(exc).lower()
Expand Down
Loading