Skip to content

Conversation

@lzx404243
Copy link
Contributor

The test org.apache.hadoop.mapred.TestClientRedirect.testRedirect is not idempotent and fail if run twice in the same JVM, because it pollutes some states shared among tests. It may be good to clean this state pollution so that some other tests do not fail in the future due to the shared state polluted by this test.

Detail

Running TestClientRedirect.testRedirect twice would result in the second run failing due to the following assertion error:

INFO  [main] service.AbstractService (AbstractService.java:noteFailure(267)) - Service test failed in state STARTED
org.apache.hadoop.yarn.exceptions.YarnRuntimeException: java.net.BindException: 

Problem binding to [0.0.0.0:8054] java.net.BindException: Address already in use

The root cause is that the RM server listening on port 8054 is started in the first run of this test, but hasn't been stopped when the test finishes. In the second run, when the test is trying to start the RMService, it fails because port 8054 is already in use, leading to the exception.

The suggested fix is to stop the RM server in the added overridden method RMService.serviceStop().

With the proposed fix, the test does not pollute the shared state (and passes when run twice in the same JVM).

JIRA link: MAPREDUCE-7342

@hadoop-yetus
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 1m 2s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 1s codespell was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 34m 26s trunk passed
+1 💚 compile 0m 37s trunk passed with JDK Ubuntu-11.0.10+9-Ubuntu-0ubuntu1.20.04
+1 💚 compile 0m 33s trunk passed with JDK Private Build-1.8.0_282-8u282-b08-0ubuntu1~20.04-b08
+1 💚 checkstyle 0m 34s trunk passed
+1 💚 mvnsite 0m 37s trunk passed
+1 💚 javadoc 0m 28s trunk passed with JDK Ubuntu-11.0.10+9-Ubuntu-0ubuntu1.20.04
+1 💚 javadoc 0m 25s trunk passed with JDK Private Build-1.8.0_282-8u282-b08-0ubuntu1~20.04-b08
+1 💚 spotbugs 0m 49s trunk passed
+1 💚 shadedclient 13m 47s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 30s the patch passed
+1 💚 compile 0m 28s the patch passed with JDK Ubuntu-11.0.10+9-Ubuntu-0ubuntu1.20.04
+1 💚 javac 0m 28s the patch passed
+1 💚 compile 0m 26s the patch passed with JDK Private Build-1.8.0_282-8u282-b08-0ubuntu1~20.04-b08
+1 💚 javac 0m 26s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 25s the patch passed
+1 💚 mvnsite 0m 28s the patch passed
+1 💚 javadoc 0m 18s the patch passed with JDK Ubuntu-11.0.10+9-Ubuntu-0ubuntu1.20.04
+1 💚 javadoc 0m 18s the patch passed with JDK Private Build-1.8.0_282-8u282-b08-0ubuntu1~20.04-b08
+1 💚 spotbugs 0m 50s the patch passed
+1 💚 shadedclient 13m 39s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 134m 59s hadoop-mapreduce-client-jobclient in the patch passed.
+1 💚 asflicense 0m 41s The patch does not generate ASF License warnings.
207m 59s
Subsystem Report/Notes
Docker ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-2968/1/artifact/out/Dockerfile
GITHUB PR #2968
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell
uname Linux d8bd48a72748 4.15.0-65-generic #74-Ubuntu SMP Tue Sep 17 17:06:04 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / bb83171
Default Java Private Build-1.8.0_282-8u282-b08-0ubuntu1~20.04-b08
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.10+9-Ubuntu-0ubuntu1.20.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_282-8u282-b08-0ubuntu1~20.04-b08
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-2968/1/testReport/
Max. process+thread count 1333 (vs. ulimit of 5500)
modules C: hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient U: hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-2968/1/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.14.0-SNAPSHOT https://yetus.apache.org

This message was automatically generated.

@lzx404243
Copy link
Contributor Author

Hi @aajisaka , could you please help reviewing this change? It resolves similar issues as #2499 . Thanks!

Copy link
Member

@aajisaka aajisaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@aajisaka aajisaka merged commit 7b5be74 into apache:trunk Aug 29, 2021
@aajisaka
Copy link
Member

Committed. Thank you @lzx404243 for your contribution!

aajisaka pushed a commit that referenced this pull request Aug 29, 2021
aajisaka pushed a commit that referenced this pull request Aug 29, 2021
kiran-maturi pushed a commit to kiran-maturi/hadoop that referenced this pull request Nov 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants