lttng: Delete suppl. files *after* the trace has been disposed in a test
authorMarc-Andre Laperle <marc-andre.laperle@ericsson.com>
Thu, 11 Sep 2014 14:38:38 +0000 (10:38 -0400)
committerMarc-Andre Laperle <marc-andre.laperle@ericsson.com>
Fri, 12 Sep 2014 02:36:55 +0000 (22:36 -0400)
That way the file handle won't be still opened when trying to delete
the suppl. folder (Windows).

Change-Id: I6e43442d715389fd3ba5265a96d9de534701f7d8
Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/33255
Tested-by: Hudson CI
Reviewed-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
org.eclipse.linuxtools.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/trace/callstack/AbstractProviderTest.java

index a7a00e95fcac355636ed50d1a9fd52f27dde9194..68841f0f16647466b8e0f64d0ebaec3e39d297de 100644 (file)
@@ -134,6 +134,7 @@ public abstract class AbstractProviderTest {
     @Test
     public void testOtherUstTrace() {
         /* Initialize the trace and analysis module */
+        File suppDir;
         try (CtfTmfTrace ustTrace = otherUstTrace.getTrace();) {
             try (TestLttngCallStackModule module = new TestLttngCallStackModule();) {
                 try {
@@ -150,11 +151,10 @@ public abstract class AbstractProviderTest {
                 assertTrue(ss.getStartTime() >= ustTrace.getStartTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue());
                 assertEquals(0, ss.getNbAttributes());
             }
-            /* Dispose the trace */
-            File suppDir = new File(TmfTraceManager.getSupplementaryFileDir(ustTrace));
-            deleteDirectory(suppDir);
-            assertFalse(suppDir.exists());
+            suppDir = new File(TmfTraceManager.getSupplementaryFileDir(ustTrace));
         }
+        deleteDirectory(suppDir);
+        assertFalse(suppDir.exists());
     }
 
     /**
This page took 0.040058 seconds and 5 git commands to generate.