rcourtman
|
20ace4fdf5
|
test: Add tests for monitor helper and metrics functions
- clearGuestMetadataCache: nil safety, cache clearing, key isolation
- shouldRunBackupPoll: interval-based, cycle-based, config validation
- storeNodeLastSuccess/lastNodeSuccessFor: store/retrieve, overwrite, missing keys
Improves coverage for backup polling logic and node metrics tracking.
|
2025-12-01 21:18:33 +00:00 |
|
rcourtman
|
ddfe2dc2c9
|
test: Add comprehensive tests for guest metadata functions
Tests for rate limiting, retry, and slot management:
- retryGuestAgentCall: timeout retry, non-timeout break, context cancellation
- acquireGuestMetadataSlot: nil safety, slot acquisition, context cancellation
- releaseGuestMetadataSlot: nil safety, non-blocking release
- tryReserveGuestMetadataFetch: reservation logic, default hold duration
- scheduleNextGuestMetadataFetch: interval, jitter, RNG handling
- deferGuestMetadataRetry: backoff logic, defaults
Covers error handling and edge cases in guest agent metadata fetching.
|
2025-12-01 21:10:28 +00:00 |
|
rcourtman
|
63ba88580e
|
test: Add unit tests for guest_metadata.go pure functions
Add comprehensive tests for:
- guestMetadataCacheKey: cache key generation with edge cases
- cloneStringSlice: nil/empty handling, deep copy verification
- cloneGuestNetworkInterfaces: nil/empty, deep address copy
- processGuestNetworkInterfaces: IP filtering (loopback, link-local),
deduplication, sorting, whitespace trimming, traffic-only interfaces
Increases monitoring package coverage from 38.9% to 39.6%.
|
2025-12-01 12:18:59 +00:00 |
|