-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AliasManager not thread-safe (causes random failing org.eclipse.core.tests.internal.alias.BasicAliasTest.testBug256837 ) #95
Comments
can be locally reproduced with Thread.sleep(200) |
It is some multi threading problem: if the whole VM is suspended at org.eclipse.core.internal.resources.ResourceTree.standardMoveProject(IProject, IProjectDescription, int, IProgressMonitor) |
Looking at the proposed patch, it's unclear to me whether the issue is the test, or the aliasManager that doesn't work as expected... Has this test always been failing (even several years ago), or did it start failing recently because of some side-effect of another change (ie this would be a regression)? |
I don't know how long it failed. It might only became obvious as hardware or software became faster or slower. |
So indeed, there is a RefreshJob running at some point in another thread, and the success or failure depends on whether this job has completed before next instruction.
In an ideal world, the "move" opreation wouldn't require to refresh the content, as we do already have some pointers to this content. It would be great to investigate that particular case: if we can get rid of the need to |
So moving the project does currently not move the .project file but write the .project with the lineseperator configured in the .project file - which does not exist yet. So the configured lineseperator may even be wrong/forgotten? it should be remembered in memory (or binary move the file instead) -> no File.getLineSeparator necessary -> no error -> no refresh -> no fail |
It's only in this particular cases (with links and different FileStore I believe) that the failure happens. The issue is not really about reading the lineSeparator, after all it's OK to try to read a line separator and to try to refresh asynchronously some content on access.
I think it's more the other way round, if there is no refresh, then the test fails (because there was no POST_CHANGE notification. |
Actually, I'm wrong and you're right: the POST_CHANGE is sent (good), AliasManager is updated (good), but then the RefreshJob triggers (because of lineSeparator and ResourcesPlugin.PREF_LIGHTWEIGHT_AUTO_REFRESH set to true), so the data from AliasManager is temporarily incorrect at the time test asks for it. |
+1 if that makes the test fail reproducible |
Goto Package Explorer > Rightclick > Refactor > Move |
InstanceScope.INSTANCE.getNode(ResourcesPlugin.PI_RESOURCES) does not make the test fail :-( |
I suggest #156 which I hope can improve this in general without need to tweak test. |
The patch did suffice for 25 days; that's a relative success! I'll try to look at further issues later. |
recent fail:
|
|
https://download.eclipse.org/eclipse/downloads/drops4/I20220428-1800/testresults/html/org.eclipse.core.tests.resources_ep424I-unit-win32-java11_win32.win32.x86_64_11.html
The text was updated successfully, but these errors were encountered: