Skip to content

Fix test failures from Catch2 submodule update#4940

Merged
Alan-Jowett merged 3 commits intomainfrom
copilot/fix-catch2-submodule-issues
Feb 17, 2026
Merged

Fix test failures from Catch2 submodule update#4940
Alan-Jowett merged 3 commits intomainfrom
copilot/fix-catch2-submodule-issues

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 26, 2026

Description

Updating Catch2 from b62413a to de7e863 changed test execution order, exposing test isolation bugs:

  1. WER report tests - Three test cases (wer_report_fatal_exception, wer_report_non_fatal_exception, wer_report_failure) depend on global state set to "Test Application Crash". The watchdog_timeout test changes this to "Test Application Hang" without reset. Under the new execution order, tests running after watchdog_timeout fail with mismatched expectations.

    Fix: Initialize expected values in each affected test case:

    WerReportCreate_test_expected_event_type = L"Test Application Crash";
    WerReportCreate_test_expected_report_type = WerReportApplicationCrash;
    WerReportAddDump_test_expected_exception_param = true;
  2. Static analysis false positive - Analyzer reports uninitialized memory for reserved_data at line 1786, despite proper initialization via ebpf_ring_buffer_reserve() and null check. New Catch2 REQUIRE macro likely not recognized as control flow break.

    Fix: Explicit re-initialization before second use: reserved_data = nullptr;

  3. CodeQL temporary file cleanup - Removed spurious _codeql_detected_source_root symlink that was accidentally committed during security analysis and added it to .gitignore to prevent future occurrences.

Testing

Existing tests in wer_report_test_wrapper.cpp and platform_unit_test.cpp now pass with updated Catch2.

Documentation

No documentation impact.

Installation

No installer impact.

Original prompt

This section details on the original issue you should resolve

<issue_title>Catch2 submodule update triggers test failures</issue_title>
<issue_description>## Summary
Updating the Catch2 submodule from b62413a to de7e863 (as proposed in PR #4933) triggers test failures that do not occur on main branch.

Failing Tests

1. Static Analysis Error (analyze / build Debug)

  • File: libs/runtime/unit/platform_unit_test.cpp line 1786
  • Error: error C6001: Using uninitialized memory 'reserved_data'
  • Context: This appears to be a false positive - the variable is set by ebpf_ring_buffer_reserve() and checked for null before use

2. Unit Test Failure (unit_tests / run_test Release)

  • File: tests/unit/wer_report_test_wrapper.cpp lines 80, 171, 213
  • Error: Test expects "Test Application Hang" but gets "Test Application Crash"
  • Details:
    • 2 test cases failed out of 373
    • 4 assertions failed out of 1,012,631

Reproduction

These failures occur in PR #4933 CI runs but pass on the main branch.

Catch2 Commits Being Added

The update includes these Catch2 changes:

  • de7e863 - Clang on Windows _MSC_VER fix
  • 024aec9 - Add efficient skip forward to Values, Map and Take generators
  • 9eca713 - Add option to skip forward to generator interface
  • 44c597f - Add Concat generator
  • 6aedc79 - Remove unused m_used_up member in ChunkGenerator
  • fcbf006 - Fix _NullFile for MinGW
  • 2580ead - Add UNSCOPED_CAPTURE
  • b59f4f3 - Rename DEPRECATED -> CATCH_DEPRECATED
  • And more...

Investigation Needed

  • Determine why updating Catch2 affects static analysis warnings
  • Determine why WER report tests fail with new Catch2 version
  • The DEPRECATED -> CATCH_DEPRECATED rename may affect code using the old macro

Related

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Fix test failures after Catch2 submodule update Fix test failures from Catch2 submodule update Jan 26, 2026
Copilot AI requested a review from Alan-Jowett January 26, 2026 19:14
@Alan-Jowett Alan-Jowett force-pushed the copilot/fix-catch2-submodule-issues branch from 61972f6 to 2ecbb72 Compare January 27, 2026 17:16
Comment thread _codeql_detected_source_root Outdated
Copy link
Copy Markdown
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

Fixes unit test failures and static analysis warnings caused by the Catch2 submodule update changing test execution order and analyzer behavior.

Changes:

  • Reset WER-report test expected globals in each affected test to avoid cross-test state leakage.
  • Initialize reserved_data to nullptr before reusing it to silence the analyzer’s uninitialized-memory warning.
  • Ignore CodeQL’s _codeql_detected_source_root artifact to prevent accidental commits.

Reviewed changes

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

File Description
tests/unit/wer_report_test_wrapper.cpp Re-initializes expected WER parameters per test to restore isolation under reordered execution.
libs/runtime/unit/platform_unit_test.cpp Explicitly initializes reserved_data before reuse to address static analysis false positive.
.gitignore Adds ignore rule for CodeQL temporary artifact.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

matthewige
matthewige previously approved these changes Jan 28, 2026
Copy link
Copy Markdown
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

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

Copy link
Copy Markdown
Member

@Alan-Jowett Alan-Jowett left a comment

Choose a reason for hiding this comment

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

LGTM - The changes correctly fix test isolation issues exposed by the Catch2 update:

  1. platform_unit_test.cpp: Re-initializing
    eserved_data = nullptr\ before the second \�bpf_ring_buffer_reserve\ call is defensive and silences the static analyzer warning correctly.

  2. wer_report_test_wrapper.cpp: Each test now explicitly sets its expected values instead of relying on global initialization. This makes tests isolated and order-independent, which is the right fix.

  3. .gitignore: Good housekeeping for CodeQL artifacts.

Ready to merge once CI passes.

Copilot AI and others added 3 commits February 13, 2026 08:39
- Reset WER test global state in each test case to avoid test order dependencies
- Initialize reserved_data to nullptr before reuse to satisfy static analyzer

Co-authored-by: Alan-Jowett <20480683+Alan-Jowett@users.noreply.github.com>
Co-authored-by: Alan-Jowett <20480683+Alan-Jowett@users.noreply.github.com>
Co-authored-by: Alan-Jowett <20480683+Alan-Jowett@users.noreply.github.com>
@Alan-Jowett Alan-Jowett force-pushed the copilot/fix-catch2-submodule-issues branch from 12f08fa to f416397 Compare February 13, 2026 16:39
Copy link
Copy Markdown
Member

@Alan-Jowett Alan-Jowett left a comment

Choose a reason for hiding this comment

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

LGTM - fixes test isolation issues exposed by Catch2 update. Tests now properly set their own expected state instead of relying on execution order.

@Alan-Jowett Alan-Jowett added this pull request to the merge queue Feb 17, 2026
Merged via the queue into main with commit 61b133d Feb 17, 2026
114 checks passed
@Alan-Jowett Alan-Jowett deleted the copilot/fix-catch2-submodule-issues branch February 17, 2026 20:47
@github-project-automation github-project-automation Bot moved this from Todo to Done in eBPF for Windows Triage Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Catch2 submodule update triggers test failures

5 participants