Skip to content

Conversation

@rickbrouwer
Copy link
Member

@rickbrouwer rickbrouwer commented Jun 18, 2025

The TestNSQAggregateDepth and TestNSQGetTopicProducers tests were failing intermittently due to a race condition in the mock HTTP server setup. The tests were using atomic.NewInt32(-1) followed by callCount.Inc() and multiple callCount.Load() calls, which could result in inconsistent values when accessed concurrently.

This happens in de amd64 test in PR #6834 and #6546

Checklist

@rickbrouwer rickbrouwer requested a review from a team as a code owner June 18, 2025 10:49
@rickbrouwer rickbrouwer changed the title fix: resolve race condition in NSQ scaler tests by fixing atomic coun… fix: resolve race condition in NSQ scaler tests Jun 18, 2025
@rickbrouwer rickbrouwer changed the title fix: resolve race condition in NSQ scaler tests fix: resolve race condition in NSQ scaler test Jun 18, 2025
@rickbrouwer rickbrouwer force-pushed the fix-race-nsq branch 3 times, most recently from 0715e74 to 2c7dd9c Compare June 18, 2025 11:14
@semgrep-app
Copy link

semgrep-app bot commented Jun 18, 2025

Semgrep found 7 no-io-writestring-to-responsewriter findings:

Detected 'io.WriteString()' writing directly to 'http.ResponseWriter'. This bypasses HTML escaping that prevents cross-site scripting vulnerabilities. Instead, use the 'html/template' package to render data to users.

@rickbrouwer rickbrouwer force-pushed the fix-race-nsq branch 2 times, most recently from 95be662 to b6b5dcf Compare June 18, 2025 11:46
@rickbrouwer
Copy link
Member Author

/skip-e2e

Copy link
Member

@zroubalik zroubalik left a comment

Choose a reason for hiding this comment

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

LGMT, thanks!

@wozniakjan wozniakjan merged commit 980637e into kedacore:main Jul 7, 2025
26 checks passed
@rickbrouwer rickbrouwer deleted the fix-race-nsq branch July 7, 2025 18:25
kmoonwright pushed a commit to kmoonwright/keda that referenced this pull request Jul 9, 2025
kmoonwright pushed a commit to kmoonwright/keda that referenced this pull request Jul 9, 2025
dpochopsky pushed a commit to dpochopsky/keda that referenced this pull request Sep 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants