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

dongjoon pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new c8e8e4090027 [SPARK-47080][CORE][TESTS] Fix `HistoryServerSuite` to 
use `constant value` and `getNumJobsRestful`
c8e8e4090027 is described below

commit c8e8e4090027c2ca9a02764740c3000373700f71
Author: Dongjoon Hyun <dh...@apple.com>
AuthorDate: Mon Feb 19 22:34:02 2024 -0800

    [SPARK-47080][CORE][TESTS] Fix `HistoryServerSuite` to use `constant value` 
and `getNumJobsRestful`
    
    ### What changes were proposed in this pull request?
    
    This PR aims to fix `HistoryServerSuite` to use a constant value, `4`, and 
`getNumJobsRestful `.
    
    ### Why are the changes needed?
    
    To remove flakiness. The test method `getNumJobsRestful()` is more robust 
than the test method `getNumJobs`.
    
    ### Does this PR introduce _any_ user-facing change?
    
    No.
    
    ### How was this patch tested?
    
    Pass the CIs and manual.
    
    I verified this by repeating 100 times.
    ```
       test("incomplete apps get refreshed") {
    +    (1 to 100).foreach { i =>
    ```
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    No.
    
    Closes #45147 from dongjoon-hyun/SPARK-47080.
    
    Authored-by: Dongjoon Hyun <dh...@apple.com>
    Signed-off-by: Dongjoon Hyun <dh...@apple.com>
---
 .../scala/org/apache/spark/deploy/history/HistoryServerSuite.scala     | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git 
a/core/src/test/scala/org/apache/spark/deploy/history/HistoryServerSuite.scala 
b/core/src/test/scala/org/apache/spark/deploy/history/HistoryServerSuite.scala
index b1738b4e742b..9131934207b7 100644
--- 
a/core/src/test/scala/org/apache/spark/deploy/history/HistoryServerSuite.scala
+++ 
b/core/src/test/scala/org/apache/spark/deploy/history/HistoryServerSuite.scala
@@ -544,7 +544,6 @@ abstract class HistoryServerSuite extends SparkFunSuite 
with BeforeAndAfter with
     eventually(stdTimeout, stdInterval) {
       assert(4 === getNumJobsRestful(), s"two jobs back-to-back not updated, 
server=$server\n")
     }
-    val jobcount = getNumJobs("/jobs")
     assert(!isApplicationCompleted(provider.getListing().next()))
 
     listApplications(false) should contain(appId)
@@ -565,7 +564,7 @@ abstract class HistoryServerSuite extends SparkFunSuite 
with BeforeAndAfter with
     listApplications(false) should not contain(appId)
 
     eventually(stdTimeout, stdInterval) {
-      assert(jobcount === getNumJobs("/jobs"))
+      assert(4 === getNumJobsRestful())
     }
 
     // no need to retain the test dir now the tests complete


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to