-
Notifications
You must be signed in to change notification settings - Fork 28.7k
[SPARK-30312][SQL][FOLLOWUP] Use inequality check instead to be robust #27175
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
Conversation
@@ -2052,7 +2052,7 @@ abstract class DDLSuite extends QueryTest with SQLTestUtils { | |||
|
|||
val fileStatus2 = fs.getFileStatus(tablePath) | |||
if (ignore) { | |||
assert(fileStatus2.getPermission().toString() == "rwxr-xr-x") | |||
assert(fileStatus2.getPermission().toString() != "rwxrwxrwx") |
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.
This is a loose condition. I think it is rarely to have default file permission as rwxrwxrwx
. Another option is not to check permission when ignore
is true.
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.
Thank you for quick follow up.
+1, LGTM as a quick fix on Jenkins environment.
The PR builder is not helpful for this because PR builder has only one umask which already passed in the previous test. |
I verified this patch manually with a different umask. Merged to master/2.4. |
### What changes were proposed in this pull request? This is a followup to fix a brittle assert in a test case. ### Why are the changes needed? Original assert assumes that default permission is `rwxr-xr-x`, but in jenkins [env](https://amplab.cs.berkeley.edu/jenkins/view/Spark%20QA%20Test%20(Dashboard)/job/spark-master-test-maven-hadoop-2.7-hive-1.2/6/testReport/junit/org.apache.spark.sql.execution.command/InMemoryCatalogedDDLSuite/SPARK_30312__truncate_table___keep_acl_permission/) it could be `rwxrwxr-x`. ### Does this PR introduce any user-facing change? No ### How was this patch tested? Unit test. Closes #27175 from viirya/hot-fix. Authored-by: Liang-Chi Hsieh <viirya@gmail.com> Signed-off-by: Dongjoon Hyun <dhyun@apple.com> (cherry picked from commit b044071) Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
Test build #116531 has finished for PR 27175 at commit
|
What changes were proposed in this pull request?
This is a followup to fix a brittle assert in a test case.
Why are the changes needed?
Original assert assumes that default permission is
rwxr-xr-x
, but in jenkins env it could berwxrwxr-x
.Does this PR introduce any user-facing change?
No
How was this patch tested?
Unit test.