[ 
https://issues.apache.org/jira/browse/MAPREDUCE-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18118737#comment-18118737
 ] 

ASF GitHub Bot commented on MAPREDUCE-7541:
-------------------------------------------

slfan1989 commented on code in PR #8652:
URL: https://github.com/apache/hadoop/pull/8652#discussion_r4091891889


##########
hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/webapp/TestAMWebApp.java:
##########
@@ -417,6 +417,36 @@ protected ClientService createClientService(AppContext 
context) {
     }
   }
 
+  @Test
+  public void testAttemptsPageRender() throws Exception {
+    MRApp app = new MRApp(2, 2, true, this.getClass().getName(), true) {
+      @Override
+      protected ClientService createClientService(AppContext context) {
+        return new MRClientService(context);
+      }
+    };
+    Configuration conf = new Configuration();
+
+    Job job = app.submit(conf);
+    String hostPort =
+        NetUtils.getHostPortString(((MRClientService) app.getClientService())
+          .getWebApp().getListenerAddress());
+    URL attemptsUrl = new URL("http://"; + hostPort + "/mapreduce/attempts/"
+        + job.getID().toString() + "/m/SUCCESSFUL");
+    app.waitForState(job, JobState.SUCCEEDED);
+
+    HttpURLConnection conn = (HttpURLConnection) attemptsUrl.openConnection();
+    assertEquals(HttpURLConnection.HTTP_OK, conn.getResponseCode(),
+        attemptsUrl.toString());
+    InputStream in = conn.getInputStream();
+    ByteArrayOutputStream out = new ByteArrayOutputStream();
+    IOUtils.copyBytes(in, out, 1024);
+
+    String content = out.toString();
+    assertTrue(content.contains("attempt_"), "Attempts Page should have the 
attepmts data");
+    app.verifyCompleted();

Review Comment:
   Could we explicitly stop the client service and the MRApp in a `finally` 
block?
   
   `verifyCompleted()` only checks timestamps. The test's job-finish handler 
calls
   `MRApp.stop()`, but `MRClientService` is managed separately and is not 
stopped
   by that call. Consequently, this test leaves its HTTP and RPC servers 
running,
   including when an assertion fails.
   
   Please ensure both `app.getClientService()` and `app` are stopped during 
cleanup.





> Fix AM WebUI attempts page
> --------------------------
>
>                 Key: MAPREDUCE-7541
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-7541
>             Project: Hadoop Map/Reduce
>          Issue Type: Bug
>    Affects Versions: 3.5.0, 3.6.0
>            Reporter: D M Murali Krishna Reddy
>            Assignee: D M Murali Krishna Reddy
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: Screenshot from 2026-08-02 18-13-04.png
>
>
> For a IN PROGRESS Mapreduce application navigating to AM UI at
> /proxy/<app_id>/mapreduce/attempts/<job_id>/m/SUCCESSFUL is not displaying 
> the successful attemps.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to