Skip to content

CI crash after upgrading to angular 20 assert.strictEqual(workerInfo.currentUsage(), 0) #30549

Closed

Description

@mattlewis92

Command

build

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

19.2.2

Description

After upgrading to Angular 20, our CI starts crashing when building the application for production:

❯ Building...
/home/runner/_work/clickup_frontend/clickup_frontend/node_modules/.pnpm/[email protected]/node_modules/piscina/src/index.ts:447
        assert.strictEqual(workerInfo.currentUsage(), 0);
               ^
AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
1 !== 0
    at Timeout._onTimeout (/home/runner/_work/clickup_frontend/clickup_frontend/node_modules/.pnpm/[email protected]/node_modules/piscina/src/index.ts:447:16)
    at listOnTimeout (node:internal/timers:588:17)
    at processTimers (node:internal/timers:523:7) {
  generatedMessage: true,
  code: 'ERR_ASSERTION',
  actual: 1,
  expected: 0,
  operator: 'strictEqual'
}

The assertion is being thrown from the piscina dependency here:
https://github.com/piscinajs/piscina/blob/fe781d66040eb87446692a3f7056c9c2c7b84a4a/src/index.ts#L447 which was added in 4.9.0 by piscinajs/piscina#590 (angular 19 uses 4.8.0 which was why this is not a problem until now)

We patched our version of the angular CLI to bump the idleTimeout here to be 10_000, and that seems to have resolved it:

Would you accept a PR to apply that patch? (or maybe it could be Infinity to disable this check completely? I'm unsure what the consequences of that change would be though)

I assume the issue is because our application source code is so large that it takes longer than 1s for the worker to initialise, and that timeout is hit.

Minimal Reproduction

A minimal repro is not possible as:

  • The problem does not always occur (presumably because the worker sometimes initialises under the current 1s idle timeout)
  • The problem only occurs on resource constrained hardware (it cannot be reproduced locally on an M3 macbook, and only within github actions)
  • The problem only seems to affect large applications (100mb+ of source code). Our smaller applications do not suffer with this problem

Exception or Error


Your Environment

Angular CLI `20.0.2` + framework `20.0.3`

Anything else relevant?

No response

Activity

  1. sod commented on Jun 17, 2025

    @sod
    Contributor

    Had the same. No reproduction yet though. Just wanted to voice you aren't the only one. node 22.16, angular 20.0.2

    Image

  2. added
    freq1: low
    on Jun 17, 2025
  3. added theissue type on Jun 17, 2025
  4. alan-agius4 commented on Jun 17, 2025

    @alan-agius4
    Collaborator

    There appears to be a race condition within Piscina where the worker idle timeout isn't being cleared before the worker is re-used and becomes active.

    While we could increase the idle timeout value as a temporary workaround until it is fixed upstream, setting it to Infinity is not ideal. Doing so would prevent idle workers from ever being terminated, leading to persistent resource consumption especially in watch mode.

    I opened an issue upstream: piscinajs/piscina#816

  5. changed the title [-]CI crash after upgrading to angular 20[/-] [+]CI crash after upgrading to angular 20 `assert.strictEqual(workerInfo.currentUsage(), 0)`[/+] on Jun 17, 2025
  6. bryanrideshark commented on Jun 17, 2025

    @bryanrideshark
    Contributor

    I'm failing to understand why they had that assert in their original logic - seems like changing that behavior would solve the whole thing.

  7. alan-agius4 commented on Jun 17, 2025

    @alan-agius4
    Collaborator
  8. added a commit that references this issue on Jun 18, 2025
    6d9c277
  9. added 2 commits that reference this issue on Jun 18, 2025
    1d76d0e
    dfe3a8b
  10. angular-automatic-lock-bot commented on Jul 19, 2025

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  11. locked and limited conversation to collaborators on Jul 19, 2025
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

    area: @angular/buildfreq1: lowseverity5: regressiontype: bug/fix

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions