mirror of
https://github.com/turbot/steampipe.git
synced 2026-03-22 10:00:23 -04:00
Fixes two flaky tests that were failing intermittently in CI: - TestPluginManager_ConcurrentUpdateRateLimiterStatus - TestPluginManager_ConcurrentRateLimiterMapAccess2 Root cause: The test writer goroutines were modifying pm.userLimiters without mutex protection, while reader goroutines were simultaneously accessing the map. Go's map implementation detects concurrent read/write access and panics with "fatal error: concurrent map read and map write". The production code in handleUserLimiterChanges (lines 98-100) correctly protects writes with pm.mut.Lock/Unlock. The tests needed to simulate this same behavior. Changes: - Added missing mut field initialization in TestPluginManager_ConcurrentUpdateRateLimiterStatus - Wrapped all pm.userLimiters writes in both tests with pm.mut.Lock/Unlock - Added comments explaining the mutex usage matches production code Testing: Ran tests 100+ times consecutively with and without -race flag, all passed successfully. Previously failed on 2nd iteration without the fix.