Skip to content
Merged
Show file tree
Hide file tree
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
38 changes: 38 additions & 0 deletions .github/workflows/miri.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# *******************************************************************************
# Copyright (c) 2025 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************

name: Miri check

on:
pull_request:
branches: [main, development]
types: [opened, ready_for_review, reopened, synchronize]

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Comment on lines +21 to +22
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

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

GITHUB_TOKEN is being exported as a job-wide environment variable, but this workflow doesn’t appear to use it directly. Consider removing it (or scoping it to the one step that needs it) to reduce unnecessary secret exposure in the runner environment.

Suggested change
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Copilot uses AI. Check for mistakes.
jobs:
miri:
runs-on: ubuntu-latest
env:
MIRIFLAGS: "-Zmiri-ignore-leaks -Zmiri-disable-isolation"
Comment on lines +25 to +27
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

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

-Zmiri-disable-isolation disables Miri’s isolation sandbox, which reduces the usefulness of CI Miri runs and broadens what tests can do on the runner. If it’s not strictly required, drop it; if it is required, add a brief note explaining what operation needs it so the flag doesn’t become a permanent blanket exception.

Suggested change
runs-on: ubuntu-latest
env:
MIRIFLAGS: "-Zmiri-ignore-leaks -Zmiri-disable-isolation"
runs-on: ubuntu-lest
env:
MIRIFLAGS: "-Zmiri-ignore-leaks"

Copilot uses AI. Check for mistakes.
steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly-2025-12-15
components: miri, rust-src

- name: Cargo Miri
run: |
cargo +nightly-2025-12-15 miri test --features stub_supervisor_api_client --no-default-features
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

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

The toolchain version is pinned twice (in dtolnay/rust-toolchain and in cargo +nightly-...). This duplication can drift over time; prefer relying on the installed toolchain (i.e., run cargo miri test without +...) or define the toolchain once (e.g., via an env var) and reuse it.

Suggested change
cargo +nightly-2025-12-15 miri test --features stub_supervisor_api_client --no-default-features
cargo miri test --features stub_supervisor_api_client --no-default-features

Copilot uses AI. Check for mistakes.
2 changes: 2 additions & 0 deletions src/health_monitoring_lib/rust/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,8 @@ mod tests {
}

#[test]
// Test is flaky for Miri.
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

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

The comment explains the test is flaky under Miri, but it doesn’t capture the failure mode or link to a tracking issue. Adding a short reason (e.g., timing/thread scheduling sensitivity) and/or an issue reference will make it clearer when it’s safe to re-enable the test for Miri.

Suggested change
// Test is flaky for Miri.
// Test is flaky under Miri due to timing and thread-scheduling sensitivity
// in this sleep-based background thread check.

Copilot uses AI. Check for mistakes.
#[cfg_attr(miri, ignore)]
fn unique_thread_runner_monitoring_works() {
let deadline_monitor = create_monitor_with_deadlines();

Expand Down
Loading