Skip to content

Fix publish pipeline - #488

Merged
Vladimir Morozov (vmoroz) merged 3 commits into
microsoft:mainfrom
vmoroz:PR/fix-publish-pipeline
Aug 7, 2026
Merged

Fix publish pipeline#488
Vladimir Morozov (vmoroz) merged 3 commits into
microsoft:mainfrom
vmoroz:PR/fix-publish-pipeline

Conversation

@vmoroz

Copy link
Copy Markdown
Member

Gets the CI (publish.yml) and Release pipelines back to green, makes test
failures diagnosable from a run, fixes two intermittently failing GC tests, and
clears a Critical Component Governance alert.

CI pipeline (.ado/publish.yml)

  • Update macOS agent images to macos-15 / macos-15-arm64. The previous
    macos-14 images are being retired, and the macos-14-arm64 label no longer
    routes on the hosted pool, which blocked the Apple-Silicon build and test jobs.
    The osx-x64 and osx-arm64 build/test jobs now target the macOS 15 images.
  • Publish test results and logs regardless of outcome. PublishTestResults
    and a new test-logs-* pipeline artifact now run with
    condition: succeededOrFailed(), and a CopyFiles step collects each test
    case's native build log next to the .trx. A failing test run is now
    diagnosable from the published artifacts instead of leaving nothing behind.
  • Report failing tests as errors. Removed continueOnError from the test-run
    step so a failed test run surfaces as a failure rather than a warning.
  • Support re-running failed jobs. The test-logs-* artifact name is suffixed
    with $(System.JobAttempt), so re-running only the failed jobs no longer
    collides with the artifact published by the previous attempt.

Flaky GC tests (test/GCTests.cs)

GCObjects and GCHandles asserted an exact GC/finalization state after a single
GC pass. Releasing a wrapped .NET object is a two-phase finalization — the first
GC finalizes the JS wrapper (freeing its handle to the .NET object) and only a
later GC collects the now-unreachable object — and GC is asynchronous across the
JS and .NET runtimes, so a single pass was unreliable and failed intermittently.
Both tests now pump GC in a bounded loop (up to 20 cycles) until the expected
state is reached before asserting. A genuine leak still fails, since the loop
exhausts and the final assertion catches it.

Component Governance (Directory.Packages.props)

Bump Nerdbank.GitVersioning from 3.6.133 to 3.10.91 to resolve a Critical
security advisory flagged against the older version.

Testing

  • CI (publish.yml) and Release pipelines pass on all platforms.
  • GC tests verified stable across repeated local runs on net10.0.

Copilot AI balanced review requested due to automatic review settings August 6, 2026 17:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@vmoroz
Vladimir Morozov (vmoroz) requested a balanced review from Copilot August 6, 2026 21:38

Copilot AI left a comment

Copy link
Copy Markdown

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 3 out of 3 changed files in this pull request and generated no new comments.

Suppressed comments (5)

.ado/publish.yml:331

  • MatrixEntry.DotnetVersion doesn’t match the matrix key DotNetVersion used elsewhere in this file (e.g., when constructing artifact paths). In Azure Pipelines template expressions, this likely resolves to empty/undefined, making runs harder to identify and potentially masking mistakes. Use MatrixEntry.DotNetVersion consistently.
                    testRunTitle: Test ${{ MatrixEntry.TargetRuntime }} ${{ MatrixEntry.DotnetVersion }}

.ado/publish.yml:37

  • The os value casing is inconsistent (macOs vs macOS). If this field is used in conditions, template logic, or reporting, inconsistent casing can cause subtle mismatches. Normalize the casing across entries (e.g., consistently macOS).
        vmImage: macos-15
        os: macOs

.ado/publish.yml:43

  • The os value casing is inconsistent (macOs vs macOS). If this field is used in conditions, template logic, or reporting, inconsistent casing can cause subtle mismatches. Normalize the casing across entries (e.g., consistently macOS).
        vmImage: macos-15-arm64
        os: macOS

test/GCTests.cs:67

  • The retry bound 20 is duplicated across tests as a magic number. Introduce a shared constant (e.g., const int MaxGcAttempts = 20;) to make the intent explicit and to keep future tuning consistent across both tests.
        // JS GC is asynchronous, so pump a bounded number of cycles until the two temporary
        // handles are released rather than asserting after a single GC.
        long handleCount = 0;
        for (int attempt = 0; attempt < 20; attempt++)
        {
            nodejs.GC();
            nodejs.Run(() => { handleCount = JSRuntimeContext.Current.GCHandleCount; });
            if (handleCount == 3 + 5)
            {
                break;
            }
        }

test/GCTests.cs:122

  • The retry bound 20 is duplicated across tests as a magic number. Introduce a shared constant (e.g., const int MaxGcAttempts = 20;) to make the intent explicit and to keep future tuning consistent across both tests.
        for (int attempt = 0; DotnetClass.Instances != 0 && attempt < 20; attempt++)
        {
            nodejs.GC();
            nodejs.Run(() => { });
            System.GC.Collect();
            System.GC.WaitForPendingFinalizers();
        }

@vmoroz
Vladimir Morozov (vmoroz) merged commit 5da09c6 into microsoft:main Aug 7, 2026
17 checks passed
@vmoroz
Vladimir Morozov (vmoroz) deleted the PR/fix-publish-pipeline branch August 7, 2026 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants