Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚨 Test: fix race condition in parallel tests #2734

Merged
merged 1 commit into from
Nov 22, 2023

Conversation

nickajacks1
Copy link
Member

@nickajacks1 nickajacks1 commented Nov 18, 2023

Description

Tests that call SetParserDecoder were causing a race condition with other tests that read from decoderPoolMap. Fix by making the offending tests not run in parallel.
This often manifested as CI failures.

To reproduce, run go test -race -v . -count=1 -run=Test_Ctx_QueryParser. It will fail virtually every time.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I have performed a self-review of my own code
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I tried to make my code as fast as possible with as few allocations as possible

Tests that call SetParserDecoder were causing a race condition with
other tests that read from decoderPoolMap. Fix by making the offending
tests not run in parallel.
Copy link
Member

@renanbastos93 renanbastos93 left a comment

Choose a reason for hiding this comment

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

LGTM

@ReneWerner87 ReneWerner87 merged commit 12e0e48 into gofiber:master Nov 22, 2023
21 checks passed
@nickajacks1 nickajacks1 deleted the testfail-raceparserdecoder branch November 22, 2023 17:50
@ReneWerner87 ReneWerner87 added this to the Next v2 Release milestone Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants