(fix): fix flaky TestReadDirSymlink#22752
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
When NewLocalETLFS was called with a rootPath that contained or ended with a symlink directory (e.g., /tmp/ABC/a/b/d/ where d is a symlink to c), the function only used filepath.Abs() which doesn't follow symlinks. This caused path resolution issues later when constructing file paths. Approved by: @reusee
User description
What type of PR is this?
Which issue(s) this PR fixes:
issue #22009
What this PR does / why we need it:
When NewLocalETLFS was called with a rootPath that contained or ended with a symlink directory (e.g., /tmp/ABC/a/b/d/ where d is a symlink to c), the function only used filepath.Abs() which doesn't follow symlinks. This caused path resolution issues later when constructing file paths.
PR Type
Bug fix, Tests
Description
Resolve symlinks in rootPath using filepath.EvalSymlinks
Prevents path resolution issues with symlinked directories
Add comprehensive test for symlink root path handling
Test verifies file operations work correctly with symlinked roots
Diagram Walkthrough
File Walkthrough
local_etl_fs.go
Add symlink resolution to rootPath initializationpkg/fileservice/local_etl_fs.go
filepath.EvalSymlinks()call to resolve symlinks in rootPathlocal_etl_fs_test.go
Add test for symlink root path resolutionpkg/fileservice/local_etl_fs_test.go
TestLocalETLFSSymlinkRootPathvalidates symlink handling