When want to read a file which are created by a test unit, access is denied

Here is the link.
https://travis-ci.org/apache/incubator-iotdb/builds/585136801
It only failed in windows platform, there was some error information, but I don’t know why.

[ERROR] Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.014 s <<< FAILURE! - in org.apache.iotdb.tsfile.read.TsFileSequenceReaderTest
[ERROR] testReadTsFileSequently(org.apache.iotdb.tsfile.read.TsFileSequenceReaderTest)  Time elapsed: 0.014 s  <<< ERROR!
java.io.FileNotFoundException: target\testTsFile.tsfile (Access is denied)
	at org.apache.iotdb.tsfile.read.TsFileSequenceReaderTest.before(TsFileSequenceReaderTest.java:54)
[ERROR] testReadTsFileSequently(org.apache.iotdb.tsfile.read.TsFileSequenceReaderTest)  Time elapsed: 0.014 s  <<< ERROR!
java.lang.NullPointerException
	at org.apache.iotdb.tsfile.read.TsFileSequenceReaderTest.after(TsFileSequenceReaderTest.java:61)

It seems like that I don’t the permissions of a file.

I don’t know enough about your code to really know what exactly is going on, but from my past experiences with dealing with Windows inform me that there are a few things that commonly cause problems:

  1. Path separator. On Linux and macOS, it is /, but on Windows, it’s \.
  2. Newline characters. On Linux and macOS, it is \n, but on Windows it’s \r\n.

In many cases these differences could be masked by tools and libraries you use, but in other cases you are responsible for accounting for differences.

A quick search in your code for this failure (testTsFile) leads me to

which seems fishy. I suggest starting from there.

If not, I suggest getting a hold of a Windows box and debug.

Good luck.

I test it in windows with almost same environment. All tests have already passed. Is it a admin privilege problem?

Imprint