Good call -- indeed that same Files class has a move() method that will try to use renameTo() and then fall back to copy() and delete() if needed for this very reason.
On Tue, Apr 15, 2014 at 6:34 AM, Ye Xianjin <advance...@gmail.com> wrote: > Hi, I think I have found the cause of the tests failing. > > I have two disks on my laptop. The spark project dir is on an HDD disk while > the tempdir created by google.io.Files.createTempDir is the > /var/folders/5q/.... ,which is on the system disk, an SSD. > The ExecutorLoaderSuite test uses > org.apache.spark.TestUtils.createdCompiledClass methods. > The createCompiledClass method first generates the compiled class in the > pwd(spark/repl), thens use renameTo to move > the file. The renameTo method fails because the dest file is in a different > filesystem than the source file. > > I modify the TestUtils.scala to first copy the file to dest then delete the > original file. The tests go smoothly. > Should I issue an jira about this problem? Then I can send a pr on Github.