Skip to content

CI: powershell job hung after a PSScriptAnalyzer runtime error; jobs have no timeout #39

Closed

Description

@eizedev

The powershell job of CI hung for 11 minutes on pull request #38 until I cancelled it. A rerun passed in 19 seconds, and #38 changes no PowerShell file.

What the log shows: 12 seconds after the step started, Invoke-ScriptAnalyzer (called once per file in the ForEach-Object loop of the step "Pester and PSScriptAnalyzer" in ci.yml) wrote

Invoke-ScriptAnalyzer: ... | You cannot have more than one dynamic module in each dynamic assembly in this version of the runtime.

and then nothing until the cancel. The job has no timeout-minutes, so a hang like this runs until GitHub's 6 hour limit.

Not affected: the browser job (has a timeout, runs in Playwright's image since #36), the release workflow's Pester run (no PSScriptAnalyzer).

Not reproduced. I do not know yet whether the error comes from PSScriptAnalyzer 1.25.0 itself, from the runner's PowerShell/.NET version, or from calling it many times in one process.

Proposal:

  • timeout-minutes on every CI job (about 10 for powershell), so a hang fails fast and visibly.
  • One Invoke-ScriptAnalyzer -Path <folder> -Recurse call per folder instead of one call per file, if that avoids the error; check against the PSScriptAnalyzer issue tracker first.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions