Skip to content

Commit

Permalink
Fix random failing IProjectTest.*OutOfSync eclipse-platform#422
Browse files Browse the repository at this point in the history
The *OutOfSync tests in IProjectTest create files in the file system and
assume them to be unsynchronized with the workspace. A concurrent
execution of the background refresh job can, however, lead to a
synchronized state of the resources in the workspace.
With this change, a potentially pending refresh is processed before
creating the file in the file system, such that its state may not
concurrently change.
  • Loading branch information
HeikoKlare authored and vogella committed Apr 27, 2023
1 parent f8a7eb0 commit 962759a
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1372,6 +1372,7 @@ public void testProjectDeletionClosedUserDefinedOutOfSync() throws CoreException
description.setLocationURI(projectStore.toURI());
ensureExistsInWorkspace(project, description);
ensureExistsInWorkspace(file, true);
waitForRefresh();
ensureExistsInFileSystem(otherFile);
fileStore = ((Resource) file).getStore();
otherFileStore = ((Resource) otherFile).getStore();
Expand Down Expand Up @@ -1623,6 +1624,7 @@ public void testProjectDeletionOpenDefaultOutOfSync() throws CoreException {
* Delete content = DEFAULT
* =======================================================================*/
ensureExistsInWorkspace(project, true);
waitForRefresh();
ensureExistsInFileSystem(file);
projectStore = ((Resource) project).getStore();
fileStore = ((Resource) file).getStore();
Expand Down Expand Up @@ -1923,6 +1925,7 @@ public void testProjectDeletionOpenUserDefinedOutOfSync() throws CoreException {
description.setLocationURI(projectStore.toURI());
ensureExistsInWorkspace(project, description);
ensureExistsInWorkspace(file, true);
waitForRefresh();
ensureExistsInFileSystem(otherFile);
fileStore = ((Resource) file).getStore();
otherFileStore = ((Resource) otherFile).getStore();
Expand Down

0 comments on commit 962759a

Please sign in to comment.