alirezazamani commented on a change in pull request #1180:
URL: https://github.com/apache/helix/pull/1180#discussion_r461799894



##########
File path: 
helix-core/src/test/java/org/apache/helix/integration/task/TestTaskSchedulingTwoCurrentStates.java
##########
@@ -65,7 +60,7 @@
  * sent when there are two CurrentStates.
  */
 public class TestTaskSchedulingTwoCurrentStates extends TaskTestBase {
-  private static final String DATABASE = WorkflowGenerator.DEFAULT_TGT_DB;

Review comment:
       The main reason is that in before class method, "TestDB" is created as 
Full-Auto and in this test we are trying to change it to Semi-Auto which causes 
race condition between controller and test updating IdealState. So if want to 
have Semi-Auto resource, we need to create it separately (with different name) 
and leverage it in this test.

##########
File path: 
helix-core/src/test/java/org/apache/helix/integration/task/TestTaskSchedulingTwoCurrentStates.java
##########
@@ -65,7 +60,7 @@
  * sent when there are two CurrentStates.
  */
 public class TestTaskSchedulingTwoCurrentStates extends TaskTestBase {
-  private static final String DATABASE = WorkflowGenerator.DEFAULT_TGT_DB;

Review comment:
       Your point is somehow valid. But I still think this is better option 
because this way we are saving many duplicated code which will be hard to 
maintain and most of the code is written in the parent class. Instead of that, 
as what I proposed in this PR, we can separate the DATABASE name and create new 
one which includes this class name and will be unique. We have same behavior 
for most of the Task Framework related test and workflow names have been 
derived from class name. This way the tests is easier to maintain and more 
understandable.

##########
File path: 
helix-core/src/test/java/org/apache/helix/integration/task/TestTaskSchedulingTwoCurrentStates.java
##########
@@ -65,7 +60,7 @@
  * sent when there are two CurrentStates.
  */
 public class TestTaskSchedulingTwoCurrentStates extends TaskTestBase {
-  private static final String DATABASE = WorkflowGenerator.DEFAULT_TGT_DB;
+  private static final String DATABASE = "TestDB_" + 
TestHelper.getTestClassName();

Review comment:
       Ok I added afterclass which basically calling super.afterclass and we 
are cleaning up the environment. Thanks for the feedback.




----------------------------------------------------------------
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]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to