JDK-8201324 : Better cleanup for test/jdk/java/net/httpclient/http2/server/TestUtil.java
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 11
  • Priority: P3
  • Status: Resolved
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2018-04-09
  • Updated: 2018-05-09
  • Resolved: 2018-05-09
Related Reports
Duplicate :  
Description
test/jdk/java/net/httpclient/http2/server/TestUtil.java is leaving files behind in /tmp on test systems:

-bash-4.2$ pwd
/tmp

-bash-4.2$ ls foo*test | wc -l
33

-bash-4.2$ ls foo*test
foo10890911788972111269test  foo13852663477531975453test  foo15896758451557728524test  foo2242993402005443341test  foo3808092886374720827test  foo4141449845919863593test  foo7951025199925027510test
foo11463475941128756213test  foo14009199666422365279test  foo16677989453915014692test  foo2645982755638711631test  foo3813149860612958327test  foo6373379158966077954test  foo898670381241645864test
foo12162218685767196189test  foo14281023251612048952test  foo17622278255938693952test  foo2658950202154812629test  foo3816312501249701999test  foo6724919987822742605test  foo9565013293079564763test
foo12259108328695205649test  foo14405816201226734706test  foo17875096503732821393test  foo2706389796393515776test  foo3868170734979293411test  foo749828099835414463test
foo13595258582298123355test  foo15736720196168187022test  foo18072898729380755513test  foo28784087290823135test    foo4067940200535274936test  foo7941595886142375660test

Comments
This was fixed in http://hg.openjdk.java.net/jdk/jdk/rev/ee6f7a61f3a5
09-05-2018

Fixed as part of 8197564: HTTP Client implementation
09-05-2018

I see you have also fixed test/jdk/java/net/httpclient/http2/server/Http2EchoHandler.java in sandbox/http-client-branch, so thanks for that.
09-04-2018

OK, thanks. I'll go after the next test that is leaving files behind.
09-04-2018

Tim, I think we have this fixed in the jdk/sandbox, just waiting on a sync up into jdk/jdk, expected early next week.
09-04-2018

Suggested fix: % hg diff diff --git a/test/jdk/java/net/httpclient/http2/server/TestUtil.java b/test/jdk/java/net/httpclient/http2/server/TestUtil.java --- a/test/jdk/java/net/httpclient/http2/server/TestUtil.java +++ b/test/jdk/java/net/httpclient/http2/server/TestUtil.java @@ -44,7 +44,8 @@ public static Path tempFile() { try { - Path p = Files.createTempFile("foo", "test"); + Path userDir = Paths.get(System.getProperty("user.dir", ".")); + Path p = Files.createTempFile(userDir, "foo", "test"); p.toFile().deleteOnExit(); return p; } catch (IOException e) { Testing now.
09-04-2018