Bug 571133: Fix sporadic test failures The FileSystemResourceManagerTest resulted in throwing several exceptions periodically on running but was not obvious what the cause was. One possibility is that many of the tests read and wrote the same file name `foo` which on a slow network drive could have resulted in tests colliding. Changing the files to be unique names per test seems to have improved this condition, but the issue is by no means fixed for sure. Change-Id: I481b6e7b1b083b6b2e2aa04effa4cbb2e9f3534f Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com>
diff --git a/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/FileSystemResourceManagerTest.java b/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/FileSystemResourceManagerTest.java index 9d5bbc3..a11099a 100644 --- a/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/FileSystemResourceManagerTest.java +++ b/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/FileSystemResourceManagerTest.java
@@ -102,7 +102,7 @@ public void testCreateFile() throws Throwable { /* initialize common objects */ IProject project = projects[0]; - File file = (File) project.getFile("foo"); + File file = (File) project.getFile("testCreateFile"); /* common contents */ String originalContent = "this string should not be equal the other"; @@ -284,7 +284,7 @@ public void testWriteFile() { /* initialize common objects */ IProject project = projects[0]; - IFile file = project.getFile("foo"); + IFile file = project.getFile("testWriteFile"); ensureExistsInWorkspace(file, true); /* common contents */ String originalContent = "this string should not be equal the other"; @@ -372,7 +372,7 @@ public void testWriteFile2() { // Bug 571133 IProject project = projects[0]; - IFile file = project.getFile("foo"); + IFile file = project.getFile("testWriteFile2"); // this file does NOT exist in workspace yet -> no ResourceInfo; @@ -397,13 +397,13 @@ public void testWriteFolder() throws Throwable { /* initialize common objects */ IProject project = projects[0]; - IFolder folder = project.getFolder("foo"); + IFolder folder = project.getFolder("testWriteFolder"); ensureExistsInWorkspace(folder, true); boolean ok; /* existing file on destination */ ensureDoesNotExistInFileSystem(folder); - IFile file = project.getFile("foo"); + IFile file = project.getFile("testWriteFolder"); ensureExistsInFileSystem(file); /* force = true */ ok = false;