| Summary: | IFileManagerExtended.deleteDirectory(FileIdentifierList) does not work. | ||||||
|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Paul Slauenwhite <paulslau> | ||||
| Component: | TPTP | Assignee: | Jonathan West <jgwest> | ||||
| Status: | CLOSED FIXED | QA Contact: | Kathy Chan <kathy> | ||||
| Severity: | critical | ||||||
| Priority: | P2 | CC: | jcayne, jptoomey | ||||
| Version: | unspecified | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Bug Depends on: | |||||||
| Bug Blocks: | 297070 | ||||||
| Attachments: |
|
||||||
|
Description
Paul Slauenwhite
In addition, there are several tests in the org.eclipse.hyades.test.execution.local package of the org.eclipse.hyades.execution plug-in that are not included in the TPTP JUnit/Plug-in test bucket: /org.eclipse.hyades.execution/src-local/org/eclipse/hyades/test/execution/local/FileManagerExtendedTest.java /org.eclipse.hyades.execution/src-local/org/eclipse/hyades/test/execution/local/FileTransferTest.java /org.eclipse.hyades.execution/src-local/org/eclipse/hyades/test/execution/local/Test.java Note, this is blocking the TPTP BVTs (JUnit Plug-in and AGR tests).
The cause may be that the file service implementation is not deleting all of the files before attempting to delete the directory. For example:
public static void deleteContent(File curr)
{
if (curr.exists())
{
if (curr.isDirectory())
{
File[] children = curr.listFiles();
if (children != null) {
for (int i = 0; i < children.length; i++)
{
deleteContent(children[i]);
}
}
}
curr.delete();
}
}
Jonathan, Please take a look for TPTP 4.6.2. Thanks Paul, I have been able to reproduce with a simple test case. Issue is due to the native Hyades file server's incorrect implementation for the delete directory command. I am working on a multi-platform implementation for this in the AC. Deferring to TPTP 4.7. Jonathan has a solution which would work on Linux but would cause a build issue on Windows. We need to resolve that build issue first before checking the fix in. What is the status on this defect for TPTP 4.7? Fix is available, I found a workaround to updating the build, awaiting time to test and commit. Jonathan, we are also seeing an odd behavior with: org.eclipse.hyades.execution.core.file.IFileManager.deleteFile(String) org.eclipse.hyades.execution.core.file.IFileManagerExtended.deleteFile(FileIdentifierList) It appears that these methods are asynchronous since some files still exist after the call returns. The work-around is to delay after the call to ensure all of the files are deleted. Shouldn't these methods be blocking like the putFile/getFile methods? See the /org.eclipse.hyades.test.core.tests/junit/harness/Test.Harness.JavaExecutionDeploymentAdapter.Test.testsuite for more details. Created attachment 159204 [details]
Patch to native file server
(In reply to comment #9) > Jonathan, we are also seeing an odd behavior with: > > org.eclipse.hyades.execution.core.file.IFileManager.deleteFile(String) > org.eclipse.hyades.execution.core.file.IFileManagerExtended.deleteFile(FileIdentifierList) > > It appears that these methods are asynchronous since some files still exist > after the call returns. The work-around is to delay after the call to ensure > all of the files are deleted. Shouldn't these methods be blocking like the > putFile/getFile methods? > > See the > /org.eclipse.hyades.test.core.tests/junit/harness/Test.Harness.JavaExecutionDeploymentAdapter.Test.testsuite > for more details. The behaviour of the native file server implementation is the same as the Java file server implementation that was previously in use. Joe Toomey may know more about why the delete operation is non-blocking on the Java side. Patch checked into HEAD. (In reply to comment #11) > (In reply to comment #9) > > Jonathan, we are also seeing an odd behavior with: > > > > org.eclipse.hyades.execution.core.file.IFileManager.deleteFile(String) > > org.eclipse.hyades.execution.core.file.IFileManagerExtended.deleteFile(FileIdentifierList) > > > > It appears that these methods are asynchronous since some files still exist > > after the call returns. The work-around is to delay after the call to ensure > > all of the files are deleted. Shouldn't these methods be blocking like the > > putFile/getFile methods? > > > > See the > > /org.eclipse.hyades.test.core.tests/junit/harness/Test.Harness.JavaExecutionDeploymentAdapter.Test.testsuite > > for more details. > > The behaviour of the native file server implementation is the same as the Java > file server implementation that was previously in use. Joe Toomey may know more > about why the delete operation is non-blocking on the Java side. Thank Jonathan. Unfortunately, Joe is no longer with the TPTP project. I have opened https://bugs.eclipse.org/bugs/show_bug.cgi?id=303077 to investigate in the future. Verified in TPTP-4.7.0-201002281900 by launching a TPTP JUnit Plug-in test with a workbench location with the clear configuration area/workspace options set. Closing. |