-
Notifications
You must be signed in to change notification settings - Fork 9.1k
HADOOP-19603. Fix TestFsShellList.testList on Windows #7771
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Conversation
* The test `org.apache.hadoop.fs.TestFsShellList#testList` creates files with special characters and tries to list them using `ls`. * Filenames with special characters aren't allowed on Windows. * Thus, we need to modify the test to only test for non-special characters on Windows and include the filenames with special characters on non-Windows environments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adjusts TestFsShellList#testList
to skip creating files with illegal characters on Windows and only include them on non-Windows platforms.
- Wraps special-character filename creations in a non-Windows check.
- Moves the
"ghi"
file creation outside of the Windows guard so it runs on all platforms.
Comments suppressed due to low confidence (1)
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestFsShellList.java:69
- The
Path
class does not define aWINDOWS
flag, causing a compilation error. You should useShell.WINDOWS
(fromorg.apache.hadoop.util.Shell
) or another appropriate platform detection mechanism.
if (!Path.WINDOWS) {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
🎊 +1 overall
This message was automatically generated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description of PR
org.apache.hadoop.fs.TestFsShellList#testList
creates files with special characters and tries to list them usingls
.How was this patch tested?
For code changes:
LICENSE
,LICENSE-binary
,NOTICE-binary
files?