Write the native MSVC result report when a prerequisite probe times out

Open Beginner friendly
#671 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
84/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
testing

Research direction

Start in tools/check_msvc_native.py at Audit.run and review how prerequisite probe failures are handled after Audit.command records timeout evidence. Add mocked regression coverage in tools/test_check_msvc_native.py and run python3 -m unittest tools.test_check_msvc_native; done means either version-probe timeout writes a failed result.json while preserving commands.json and prevents scenario compilation.

Written by the indexing model from the issue text.

Description

bug ci good first issue

Problem

In Audit.run, the initial clang-cl --version and wavec -V probes run outside Audit.case. Audit.command records a timeout and rethrows subprocess.TimeoutExpired, but the outer exception handler does not catch that exception. Execution skips the result.json write.

This leaves commands.json with useful evidence but no final machine-readable failure summary. The job correctly fails; this issue is about preserving its report, not changing timeout success semantics.

Reproduction

Reproduced on master 0c32b946 without Windows or an installed SDK, by injecting a prerequisite timeout:

import argparse
import subprocess
import tempfile
from pathlib import Path
from unittest.mock import patch
from tools.check_msvc_native import Audit

with tempfile.TemporaryDirectory() as temporary:
    root = Path(temporary)
    audit = Audit(argparse.Namespace(
        output=root / 'audit', wavec=root / 'wavec.exe',
        llvm_bin=root / 'llvm/bin', target='aarch64-pc-windows-msvc'))
    with patch('tools.check_msvc_native.require_native'), patch(
        'tools.check_msvc_native.run_process',
        side_effect=subprocess.TimeoutExpired(
            ['clang-cl.exe', '--version'], 90, output=b'partial probe')):
        try:
            audit.run()
        except subprocess.TimeoutExpired:
            pass
    print((audit.output / 'commands.json').exists())  # True
    print((audit.output / 'result.json').exists())    # False: should be True

Bounded change

Difficulty: easy. Suitable for a first contribution: timeout recording already works inside scenario execution. Extend prerequisite failure handling so the final report is written before propagating a failure.

Acceptance:

  • Timeouts in either version probe produce result.json with passed: false, the selected target, and a prerequisite failure.
  • Preserve timeout duration, command identity and partial output in commands.json.
  • Do not start scenario compilation after prerequisite failure and do not convert it into a skip/pass.
  • Add fast mocked regression tests in tools/test_check_msvc_native.py; no 90-second wait or Windows host is required.
  • Existing missing-tool and per-scenario failure behavior stays covered.

Validation command: python3 -m unittest tools.test_check_msvc_native.

Dominant language
Rust
Stars
53
Forks
16
Avg merge
4h 6m
Merged PRs (30d)
44

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from wavefnd/Wave

All issues in wavefnd/Wave

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.