Skip to content

Conversation

@bbockelm
Copy link
Collaborator

  • Fix federation discovery race: Force GetFederation() to run immediately after setting config to prevent sync.Once from capturing empty viper state
  • Fix nil pointer dereferences: Check for nil before calling Value() on cache lookups in 7 test cases
  • Fix goroutine leaks: Properly capture and wait for cancel/egrp in TestDiscoverOriginCache, TestRedirects, and TestGetHealthTestFile

The sporadic test failure occurred when background goroutines called GetFederation() between ResetConfig() and param.Set(), causing the sync.Once to execute with empty config and cache that state permanently.

Fixes: #2918

@bbockelm bbockelm added bug Something isn't working test Improvements to the test suite director Issue relating to the director component labels Dec 20, 2025
@bbockelm bbockelm force-pushed the fix-director-registration-race branch from 87e8a9f to a9294c4 Compare December 20, 2025 23:17
- Fix federation discovery race: Force GetFederation() to run immediately
  after setting config to prevent sync.Once from capturing empty viper state
- Fix nil pointer dereferences: Check for nil before calling Value() on
  cache lookups in 7 test cases
- Fix goroutine leaks: Properly capture and wait for cancel/egrp in
  TestDiscoverOriginCache, TestRedirects, and TestGetHealthTestFile

The sporadic test failure occurred when background goroutines called
GetFederation() between ResetConfig() and param.Set(), causing the
sync.Once to execute with empty config and cache that state permanently.
@bbockelm bbockelm force-pushed the fix-director-registration-race branch from a9294c4 to 997e553 Compare December 20, 2025 23:34
Copy link
Collaborator Author

@bbockelm bbockelm left a comment

Choose a reason for hiding this comment

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

LGTM

@bbockelm bbockelm merged commit 5f15e67 into PelicanPlatform:main Dec 21, 2025
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working director Issue relating to the director component test Improvements to the test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix flakey director tests

1 participant