File tree 2 files changed +8
-7
lines changed
clients/venice-push-job/src
main/java/com/linkedin/venice/hadoop
test/java/com/linkedin/venice/hadoop 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -668,8 +668,7 @@ public void run() {
668
668
pushJobSetting .storeName ,
669
669
pushJobSetting .clusterName );
670
670
671
- long bootstrapToOnlineTimeoutInHours =
672
- getStoreResponse (pushJobSetting .storeName ).getStore ().getBootstrapToOnlineTimeoutInHours ();
671
+ long bootstrapToOnlineTimeoutInHours = getBootstrapToOnlineTimeoutInHours ();
673
672
timeoutExecutor .schedule (() -> {
674
673
cancel ();
675
674
throw new VeniceException (
@@ -2645,6 +2644,12 @@ public String getTopicToMonitor() {
2645
2644
return getTopicToMonitor (this .pushJobSetting );
2646
2645
}
2647
2646
2647
+ // Visible for testing
2648
+ public long getBootstrapToOnlineTimeoutInHours () {
2649
+ // getStoreResponse() is necessary because this is called at the very start of the job
2650
+ return getStoreResponse (pushJobSetting .storeName ).getStore ().getBootstrapToOnlineTimeoutInHours ();
2651
+ }
2652
+
2648
2653
private String getTopicToMonitor (PushJobSetting pushJobSetting ) {
2649
2654
return Version .isRealTimeTopic (pushJobSetting .topic )
2650
2655
? Version .composeKafkaTopic (pushJobSetting .storeName , pushJobSetting .version )
Original file line number Diff line number Diff line change @@ -335,11 +335,6 @@ public void testDataWriterComputeJobTimeout(Class<? extends DataWriterComputeJob
335
335
doReturn (response ).when (client ).killOfflinePushJob (anyString ());
336
336
337
337
try (VenicePushJob pushJob = getSpyVenicePushJob (props , client )) {
338
- StoreInfo storeInfo = new StoreInfo ();
339
- storeInfo .setBootstrapToOnlineTimeoutInHours (0 );
340
- PushJobSetting pushJobSetting = pushJob .getPushJobSetting ();
341
- pushJobSetting .storeResponse = new StoreResponse ();
342
- pushJobSetting .storeResponse .setStore (storeInfo );
343
338
CountDownLatch runningJobLatch = new CountDownLatch (1 );
344
339
CountDownLatch killedJobLatch = new CountDownLatch (1 );
345
340
skipVPJValidation (pushJob );
@@ -369,6 +364,7 @@ public void testDataWriterComputeJobTimeout(Class<? extends DataWriterComputeJob
369
364
370
365
try {
371
366
doCallRealMethod ().when (pushJob ).runJobAndUpdateStatus ();
367
+ doReturn (0L ).when (pushJob ).getBootstrapToOnlineTimeoutInHours (); // timeoutExecutor can immediately run
372
368
DataWriterComputeJob dataWriterJob = spy (pushJob .getDataWriterComputeJob ());
373
369
pushJob .setDataWriterComputeJob (dataWriterJob );
374
370
doNothing ().when (dataWriterJob ).validateJob ();
You can’t perform that action at this time.
0 commit comments