Skip to content

Commit

Permalink
fix the retry test
Browse files Browse the repository at this point in the history
  • Loading branch information
eschultink committed May 30, 2024
1 parent 3ed1ec3 commit 3001f71
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,7 @@
import com.google.appengine.tools.pipeline.impl.tasks.Task;
import com.google.apphosting.api.ApiProxy;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.*;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
Expand Down Expand Up @@ -84,6 +79,11 @@ private static Queue getQueue(String queueName) {
Map<String, Object> attributes = ApiProxy.getCurrentEnvironment().getAttributes();
queueName = (String) attributes.get(TaskHandler.TASK_QUEUE_NAME_HEADER);
}
//good idea? seems needed to make tests pass in CI now; risk is that if someone uses a queue named 'default', but
// it's not the *default* queue
if (Objects.equals(queueName, "default")) {
queueName = null;
}
return queueName == null ? QueueFactory.getDefaultQueue() : QueueFactory.getQueue(queueName);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,12 @@
import com.google.appengine.tools.pipeline.JobSetting.MaxAttempts;


import com.google.appengine.tools.pipeline.impl.PipelineManager;
import com.google.common.base.Stopwatch;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import org.junit.jupiter.api.extension.ExtendWith;
import org.opentest4j.AssertionFailedError;

import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;

Expand Down Expand Up @@ -61,6 +59,11 @@ public void setUp(PipelineService pipelineService) throws Exception {
this.pipelineService = pipelineService;
}

@BeforeEach
public void setPipelineManager(PipelineManager pipelineManager) {
TestingTaskQueueCallback.pipelineManager = pipelineManager;
}

@AfterEach
public void tearDown() throws Exception {
helper.tearDown();
Expand Down

0 comments on commit 3001f71

Please sign in to comment.