tmf: Fix deletion of supplementary files in unit tests
authorPatrick Tasse <patrick.tasse@gmail.com>
Tue, 21 Feb 2017 20:45:06 +0000 (15:45 -0500)
committerPatrick Tasse <patrick.tasse@gmail.com>
Wed, 22 Feb 2017 19:09:54 +0000 (14:09 -0500)
The trace should be disposed before attempting to delete supplementary
files, otherwise the checkpoint indexer could still be holding a file
handle to the index, and file deletion fails in Windows.

Change-Id: I81f04dfd198c9a49f1dfdce36673e532bdf8b54d
Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-on: https://git.eclipse.org/r/91576
Reviewed-by: Hudson CI
Reviewed-by: Marc-André Laperle <marc-andre.laperle@ericsson.com>
Tested-by: Marc-André Laperle <marc-andre.laperle@ericsson.com>
ctf/org.eclipse.tracecompass.tmf.ctf.core.tests/src/org/eclipse/tracecompass/tmf/ctf/core/tests/temp/statistics/TmfStateStatisticsTest.java
ctf/org.eclipse.tracecompass.tmf.ctf.core.tests/src/org/eclipse/tracecompass/tmf/ctf/core/tests/temp/tracemanager/TmfTraceManagerUtilityTest.java

index 39d04cf9aa71906dca6bba17a22536ba173d6f64..54d006154045dc63169fb40fa89f98d93531d989 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2012, 2014 Ericsson
+ * Copyright (c) 2012, 2017 Ericsson
  *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
@@ -78,7 +78,7 @@ public class TmfStateStatisticsTest extends TmfStatisticsTest {
     public void tearDown() {
         fTotalsMod.dispose();
         fEventTypesMod.dispose();
-        TmfTraceManager.deleteSupplementaryFiles(NonNullUtils.checkNotNull(fTrace));
         fTrace.dispose();
+        TmfTraceManager.deleteSupplementaryFiles(NonNullUtils.checkNotNull(fTrace));
     }
 }
index 37b3a61cd7f757b00717ed38e6d390b609ed7c8d..177c6ef14600eb39c6cd42224934ef11c53aaf8b 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2016 EfficiOS Inc., Alexandre Montplaisir
+ * Copyright (c) 2016, 2017 EfficiOS Inc., Alexandre Montplaisir
  *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
@@ -85,7 +85,7 @@ public class TmfTraceManagerUtilityTest {
              * supplementary files already.
              */
             assertFalse(isDirectoryEmpty(suppFilesPath));
-
+            trace.dispose();
             TmfTraceManager.deleteSupplementaryFiles(trace);
             assertTrue(isDirectoryEmpty(suppFilesPath));
 
This page took 0.026407 seconds and 5 git commands to generate.