xonx4l opened a new pull request, #19140: URL: https://github.com/apache/datafusion/pull/19140
## Which issue does this PR close? - Closes https://github.com/apache/datafusion/issues/19114. ## Rationale for this change The test test_cache_with_ttl_and_lru was flaky and failing intermittently in CI. It relied on std::thread::sleep and Instant::now(), which caused race conditions when the test environment was slow or under load. This PR makes the test correct by removing reliance on the system clock and thread sleeping. ## What changes are included in this PR? -> Introduced a TimeProvider trait to abstract time retrieval. -> Refactored DefaultListFilesCache to use provider. -> Added DefaultListFilesCache::new_with_provider for testing purposes. -> Updated test_cache_with_ttl_and_lru to use a MockTimeProvider. ## Are these changes tested? Yes. I verified the fix by running the specific test locally without failure. <!-- If there are any breaking changes to public APIs, please add the `api change` label. -->No. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
