test: resolve flakiness in worker*.test-free-called by MrJithil · Pull Request #51013 · nodejs/node

@nodejs-github-bot added addons

Issues and PRs related to native addons.

needs-ci

PRs that need a full CI run.

test

Issues and PRs related to the tests.

labels

Dec 2, 2023

H4ad

H4ad approved these changes Dec 2, 2023

@MrJithil MrJithil added the author ready

PRs that have at least one approval, no pending requests for changes, and a CI started.

label

Dec 6, 2023

joyeecheung

@H4ad H4ad added the commit-queue

Add this label to land a pull request using GitHub Actions.

label

Dec 7, 2023

@MrJithil

The issue arises from the `getFreeCallCount()` function yielding the
initial value of 0. Upon instantiation of the `Worker` object, it
increments to 1. In the case of this flaky test, if the creation of the
`Worker` object is faster, the subsequent `getFreeCallCount()` call
always returns 1 instead of the expected 0.

Fixes: nodejs#51003

@MrJithil MrJithil changed the title fix: resolve flakiness in worker*.test-free-called test: resolve flakiness in worker*.test-free-called

Dec 9, 2023

H4ad

H4ad approved these changes Dec 9, 2023

UlisesGascon

@H4ad H4ad added the commit-queue

Add this label to land a pull request using GitHub Actions.

label

Dec 19, 2023

RafaelGSS pushed a commit that referenced this pull request

Jan 2, 2024
The issue arises from the `getFreeCallCount()` function yielding the
initial value of 0. Upon instantiation of the `Worker` object, it
increments to 1. In the case of this flaky test, if the creation of the
`Worker` object is faster, the subsequent `getFreeCallCount()` call
always returns 1 instead of the expected 0.

Fixes: #51003
PR-URL: #51013
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

richardlau pushed a commit that referenced this pull request

Mar 25, 2024
The issue arises from the `getFreeCallCount()` function yielding the
initial value of 0. Upon instantiation of the `Worker` object, it
increments to 1. In the case of this flaky test, if the creation of the
`Worker` object is faster, the subsequent `getFreeCallCount()` call
always returns 1 instead of the expected 0.

Fixes: #51003
PR-URL: #51013
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>