Skip to content

Issue 3: Potential Race Condition in test_ParallelEventSync #161

@PrinceSajjadHussain

Description

@PrinceSajjadHussain

Body:
The test_ParallelEventSync test uses threads to call limiter.CheckRateLimit("testMethod"). While this tests the rate limiter in a concurrent scenario, there is a potential race condition. The test checks assert limiter.counters["testMethod"] == 3 after all threads have joined. However, there's no guarantee that all threads have completely finished incrementing the counter before the assertion is made. A more robust approach would be to use a synchronization mechanism (e.g., a barrier or a lock) to ensure all threads have finished their operations before the assertion is checked. This will make the test more reliable and prevent occasional failures due to timing issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions