AtingTot / wave-protocol

Automatically exported from code.google.com/p/wave-protocol
0 stars 0 forks source link

testRecoverFromTruncatedDeltas doesn't close a file causing the tearDown to fail on Windows XP. #183

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run testRecoverFromTruncatedDeltas unit test in Windows XP.

What is the expected output? What do you see instead?
I would expect the test to succeed instead it fails while trying to delete the 
temp directory for this test.

What version of the product are you using? On what operating system?
I'm not sure how to get this.

Please provide any additional information below.

Original issue reported on code.google.com by smadiron...@gmail.com on 16 Dec 2010 at 5:58

GoogleCodeExporter commented 9 years ago
I don't have access to a windows machine to reproduce this. Can you explain 
which file is not being closed?

Original comment by ano...@google.com on 16 Dec 2010 at 9:55

GoogleCodeExporter commented 9 years ago
I committed smadirondack's patch in revision baa00ea909, so I assume it's fixed 
now. Otherwise, please reopen this bug report.

Original comment by so...@google.com on 16 Dec 2010 at 10:11

GoogleCodeExporter commented 9 years ago
Sorry for not getting back with this. The file is named "file" and is declared 
in testRecoverFromTruncatedDeltas. My Change was to add "file.close()." I have 
tested this on Windows XP and it works find. It also works fine on my Amazon 
EC2 Ubuntu instance.

RandomAccessFile file = new RandomAccessFile(deltaFile, "rw");
if (toRemove > file.length()) {
  file.close();
  break;
}

Original comment by smadiron...@gmail.com on 17 Dec 2010 at 6:34