[
https://issues.apache.org/jira/browse/HDFS-15691?focusedWorklogId=517690&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-517690
]
ASF GitHub Bot logged work on HDFS-15691:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 29/Nov/20 22:59
Start Date: 29/Nov/20 22:59
Worklog Time Spent: 10m
Work Description: lzx404243 commented on a change in pull request #2482:
URL: https://github.com/apache/hadoop/pull/2482#discussion_r532282135
##########
File path:
hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/servlet/TestServerWebApp.java
##########
@@ -43,6 +43,8 @@ public void getHomeDir() {
assertEquals(ServerWebApp.getDir("TestServerWebApp0", ".log.dir",
"/tmp/log"), "/tmp/log");
System.setProperty("TestServerWebApp0.log.dir", "/tmplog");
assertEquals(ServerWebApp.getDir("TestServerWebApp0", ".log.dir",
"/tmp/log"), "/tmplog");
+ System.clearProperty("TestServerWebApp0.home.dir");
+ System.clearProperty("TestServerWebApp0.log.dir");
Review comment:
Hi @aajisaka,
thanks for your review! You raised some good points.
Per further discussion with Xiaoqiao He in [jira
link](https://issues.apache.org/jira/browse/HDFS-15691?focusedCommentId=17237118&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17237118),
it looks like setting the system properties can be harmless as system
properties are not reused in different tests.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 517690)
Time Spent: 0.5h (was: 20m)
> Fix flaky test TestServerWebApp.getHomeDir
> ------------------------------------------
>
> Key: HDFS-15691
> URL: https://issues.apache.org/jira/browse/HDFS-15691
> Project: Hadoop HDFS
> Issue Type: Bug
> Environment: macOS 10.15.6
> java version "1.8.0_151"
> Java(TM) SE Runtime Environment (build 1.8.0_151-b12)
> Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)
> Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
>
> Reporter: Zhengxi Li
> Assignee: Zhengxi Li
> Priority: Minor
> Labels: pull-request-available
> Attachments: HDFS-15691.001.patch
>
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> The test '{{org.apache.hadoop.lib.servlet.TestServerWebApp.getHomeDir'}} is
> not idempotent and fails if run twice in the same JVM, because it pollutes
> state 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.
>
> PR link: https://github.com/apache/hadoop/pull/2482
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]