Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 311814 - Re-launching a JUnit Plug-in Test Suite is slow to clear the workspace location
Summary: Re-launching a JUnit Plug-in Test Suite is slow to clear the workspace location
Status: CLOSED WONTFIX
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: PDE-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2010-05-05 22:13 EDT by Jevon CLA
Modified: 2019-09-09 02:45 EDT (History)
1 user (show)

See Also:


Attachments
tracedump from JVisualVM (14.34 KB, text/plain)
2010-05-09 21:03 EDT, Jevon CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jevon CLA 2010-05-05 22:13:02 EDT
Build Identifier: M20100211-1343

In my project, I am running a JUnit plugin test suite that makes a large workspace, at least in terms of the number of files (~20,000) and directories (~5,000). The absolute size of the created workspace isn't very large; about 100 MB.

If I try to relaunch the suite again, Eclipse appears to freeze for a few minutes. I have set the suite to clear the entire workspace. Upon further investigation it looks like it freezes while it is clearing the workspace; once the workspace is empty, Eclipse unfreezes and continues as normal.

I'm not sure if this is an issue in the way that the workspace is cleared; does Eclipse recurse over the workspace directory and delete each file individually? I had a look around in the JDT, JUnit and Debug Launching source code and couldn't find a reference to where it creates or refreshes the target workspace.

I think in the meantime I can workaround this by simply deleting the directory manually before re-launching the JUnit plugin test suite, but this seems like an unnecessary step for something as trivial as clearing a directory.

Not sure where this should be filed in the bugzilla.

Reproducible: Always

Steps to Reproduce:
1. Run a JUnit plugin test suite that has a specified Workspace directory, which creates about 100 MB of workspace data in 20,000 files.
2. Try to relaunch the plugin test suite once it has completed.
3. Observe Eclipse appears to freeze until the workspace has been cleared.
Comment 1 Jevon CLA 2010-05-06 20:05:15 EDT
I tested deleting the folder manually using `rmdir /s`. For 39540 files across 11843 directories, it took approximately 110 seconds; about 25% of the time needed for Eclipse to remove the contents. Is this a reasonable increase in cost for Java/Eclipse?
Comment 2 Dani Megert CLA 2010-05-07 05:09:59 EDT
>If I try to relaunch the suite again, Eclipse appears to freeze for a few
>minutes.
Please provide a stack dump, see http://wiki.eclipse.org/index.php/How_to_report_a_deadlock#Getting_a_stack_trace_on_Windows for details.
Comment 3 Jevon CLA 2010-05-09 21:03:14 EDT
Created attachment 167644 [details]
tracedump from JVisualVM

Attached is the thread dump from JVisualVM, it looks like it is busy deleting directories recursively. I didn't realise there is no way in Java to delete a non-empty folder directly.
Comment 4 Eclipse Webmaster CLA 2019-09-06 16:13:35 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.
Comment 5 Julian Honnen CLA 2019-09-09 02:45:02 EDT
Please remove the stalebug flag, if this issue is still relevant and can be reproduced on the latest release.