This is an automated email from the ASF dual-hosted git repository.

dongjoon-hyun pushed a commit to branch branch-4.x
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/branch-4.x by this push:
     new aec1d9d7f768 [SPARK-56881][CORE][TESTS] Improve 
`FsHistoryProviderSuite` to be more robust
aec1d9d7f768 is described below

commit aec1d9d7f76831509f591f958f1a76ac185f531c
Author: Dongjoon Hyun <[email protected]>
AuthorDate: Fri May 15 13:52:49 2026 -0700

    [SPARK-56881][CORE][TESTS] Improve `FsHistoryProviderSuite` to be more 
robust
    
    ### What changes were proposed in this pull request?
    
    Skip the `SPARK-3697: ignore files that cannot be read.` test when the file 
remains readable after `setReadable(false, false)` (i.e. running as `root`).
    
    ```scala
        logFile2.setReadable(false, false)
        assume(!logFile2.canRead, "Test requires the file to be unreadable; " +
          "skipping when running as root.")
    ```
    
    ### Why are the changes needed?
    
    `root` bypasses POSIX permission checks, so the test's precondition 
(unreadable file) does not hold and the assertions fail. This mirrors the 
existing `assume(!Utils.isWindows)` skip on the line above.
    
    ### Does this PR introduce _any_ user-facing change?
    
    No.
    
    ### How was this patch tested?
    
    Pass the CIs.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    Generated-by: Claude Code (Opus 4.7)
    
    Closes #55908 from dongjoon-hyun/SPARK-56881.
    
    Authored-by: Dongjoon Hyun <[email protected]>
    Signed-off-by: Dongjoon Hyun <[email protected]>
    (cherry picked from commit feba6f9b1ee8a9a5499c9461d11afe049a333b96)
    Signed-off-by: Dongjoon Hyun <[email protected]>
---
 .../org/apache/spark/deploy/history/FsHistoryProviderSuite.scala      | 4 ++++
 1 file changed, 4 insertions(+)

diff --git 
a/core/src/test/scala/org/apache/spark/deploy/history/FsHistoryProviderSuite.scala
 
b/core/src/test/scala/org/apache/spark/deploy/history/FsHistoryProviderSuite.scala
index cb1906679e55..829010179bda 100644
--- 
a/core/src/test/scala/org/apache/spark/deploy/history/FsHistoryProviderSuite.scala
+++ 
b/core/src/test/scala/org/apache/spark/deploy/history/FsHistoryProviderSuite.scala
@@ -212,6 +212,10 @@ abstract class FsHistoryProviderSuite extends 
SparkFunSuite with Matchers with P
       SparkListenerApplicationEnd(2L)
       )
     logFile2.setReadable(false, false)
+    // setReadable(false) is a no-op for root users since they bypass file
+    // permission checks. Skip the test in that case.
+    assume(!logFile2.canRead, "Test requires the file to be unreadable; " +
+      "skipping when running as root.")
 
     updateAndCheck(provider) { list =>
       list.size should be (1)


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to