Skip to content

Replace random number with unique and deterministic name#2013

Merged
dirkkul merged 2 commits intomainfrom
fix_flaky_user_test
Apr 16, 2026
Merged

Replace random number with unique and deterministic name#2013
dirkkul merged 2 commits intomainfrom
fix_flaky_user_test

Conversation

@dirkkul
Copy link
Copy Markdown
Collaborator

@dirkkul dirkkul commented Apr 15, 2026

would sometimes cause a test to fail with duplicate names

Copilot AI review requested due to automatic review settings April 15, 2026 06:53
Copy link
Copy Markdown

@orca-security-eu orca-security-eu Bot left a comment

Choose a reason for hiding this comment

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

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Passed Passed SAST high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the RBAC user integration tests to use deterministic, sanitized user IDs derived from the pytest node name, avoiding flakiness from random-name collisions.

Changes:

  • Removed random-number-based user ID generation in favor of a deterministic _unique_user_id() helper.
  • Added request fixture usage to relevant tests to derive per-test user IDs.
  • Centralized user ID sanitization via _sanitize_collection_name().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread integration/test_users.py Outdated
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.93%. Comparing base (4d66220) to head (f2cf965).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2013      +/-   ##
==========================================
- Coverage   87.93%   87.93%   -0.01%     
==========================================
  Files         280      280              
  Lines       21664    21666       +2     
==========================================
+ Hits        19051    19052       +1     
- Misses       2613     2614       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dirkkul dirkkul merged commit 5a32208 into main Apr 16, 2026
240 of 244 checks passed
@dirkkul dirkkul deleted the fix_flaky_user_test branch April 16, 2026 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants