Blazer-007 commented on code in PR #4092:
URL: https://github.com/apache/gobblin/pull/4092#discussion_r1945968829
##########
gobblin-temporal/src/test/java/org/apache/gobblin/temporal/yarn/DynamicScalingYarnServiceManagerTest.java:
##########
@@ -69,14 +69,14 @@ public void testWhenScalingDirectivesIsNulOrEmpty() throws
IOException, Interrup
/** Note : this test uses {@link DummyScalingDirectiveSource}*/
@Test
public void testWithDummyScalingDirectiveSource() throws IOException,
InterruptedException {
- // DummyScalingDirectiveSource returns 2 scaling directives in first 3
invocations and after that it returns empty list
- // so the total number of invocations after three invocations should
always be 3
+ // DummyScalingDirectiveSource returns 2 scaling directives in first 5
invocations and after that it returns empty list
+ // so the total number of invocations after three invocations should
always be 5
TestDynamicScalingYarnServiceManager testDynamicScalingYarnServiceManager
= new TestDynamicScalingYarnServiceManager(
mockGobblinTemporalApplicationMaster, new
DummyScalingDirectiveSource());
testDynamicScalingYarnServiceManager.startUp();
- Thread.sleep(5000); // 5 seconds sleep so that
GetScalingDirectivesRunnable.run() is called for 5 times
+ Thread.sleep(7000); // 5 seconds sleep so that
GetScalingDirectivesRunnable.run() is called for 7 times
testDynamicScalingYarnServiceManager.shutDown();
- Mockito.verify(mockDynamicScalingYarnService,
Mockito.times(3)).reviseWorkforcePlanAndRequestNewContainers(Mockito.anyList());
+ Mockito.verify(mockDynamicScalingYarnService,
Mockito.times(5)).reviseWorkforcePlanAndRequestNewContainers(Mockito.anyList());
Review Comment:
In case of scaling directives returned by `ScalingDirectiveSource` impl
`reviseWorkforcePlanAndRequestNewContainers` is called that many times
here `DummyScalingDirectiveSource` returns scaling directives for 5 times so
5 invocations must happens to `reviseWorkforcePlanAndRequestNewContainers`
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]