[
https://issues.apache.org/jira/browse/GOBBLIN-1292?focusedWorklogId=503402&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-503402
]
ASF GitHub Bot logged work on GOBBLIN-1292:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 21/Oct/20 21:21
Start Date: 21/Oct/20 21:21
Worklog Time Spent: 10m
Work Description: aplex commented on a change in pull request #3131:
URL: https://github.com/apache/incubator-gobblin/pull/3131#discussion_r509700611
##########
File path:
gobblin-cluster/src/test/java/org/apache/gobblin/cluster/FsJobConfigurationManagerTest.java
##########
@@ -91,6 +91,10 @@ public void setUp() throws IOException {
return null;
}).when(this.eventBus).post(Mockito.anyObject());
+ File tmpDir = Files.createTempDir();
+ tmpDir.deleteOnExit();
+ this.jobConfDir = tmpDir.getAbsolutePath() + "/" +
this.getClass().getSimpleName() + "/jobCatalog";
Review comment:
Is it important to have a class name in this path? AFAIK, createTempDir
will return a unique path on each call. (same in other test classes below)
##########
File path:
gobblin-cluster/src/test/java/org/apache/gobblin/cluster/suite/IntegrationJobCancelSuite.java
##########
@@ -17,14 +17,22 @@
package org.apache.gobblin.cluster.suite;
+import java.io.File;
+
import org.junit.Assert;
+import com.google.common.io.Files;
import com.typesafe.config.Config;
public class IntegrationJobCancelSuite extends IntegrationBasicSuite {
public static final String JOB_ID = "job_HelloWorldTestJob_1234";
- public static final String TASK_STATE_FILE =
"/tmp/IntegrationJobCancelSuite/taskState/_RUNNING";
+ public static final String TASK_STATE_FILE;
+ static {
+ File tmpDir = Files.createTempDir();
Review comment:
Does this need to happen in static block? Can it happen for the instance
of a class? Accessing file system from static block looks strange to me. Also
TASK_STATE_FILE seems to be like a constant, but it changes on every
application run.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 503402)
Time Spent: 1h (was: 50m)
> Undo hardcoded tmp directory locations for unit tests
> -----------------------------------------------------
>
> Key: GOBBLIN-1292
> URL: https://issues.apache.org/jira/browse/GOBBLIN-1292
> Project: Apache Gobblin
> Issue Type: Improvement
> Components: misc
> Affects Versions: 0.15.0
> Reporter: Sudarshan Vasudevan
> Priority: Major
> Fix For: 0.15.0
>
> Time Spent: 1h
> Remaining Estimate: 0h
>
> Several unit tests in Gobblin make use of hardcoded tmp directory locations.
> If these locations are not cleaned up, they have the potential to cause test
> failures in subsequent builds. Further, hardcoded locations may potentially
> collide with other tests which may accidentally use the same location. This
> task modifies a host of tests to use dynamically generated temp directories
> which are automatically cleaned up when tests complete.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)