Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
v1r3n committed Oct 18, 2022
1 parent 511f5c7 commit e75df9b
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ dependencies {

implementation "org.slf4j:slf4j-api:${versions.slf4j}"

api 'io.orkes.conductor:orkes-conductor-common-protos:0.9.1'
api 'io.orkes.conductor:orkes-conductor-common-protos:0.9.2'

//gRPC dependencies
implementation ("io.grpc:grpc-netty:${versions.ioGRPC}") {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=3.0.14
version=3.0.22
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ public void runAccumulatedRequests() {
if (currentPending <= 0) {
return;
}
if(currentPending > 20) {
currentPending = 20;
}
// Make GRPC call for these many
// Observe for results, add them to local queue
if (callAgain.get()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ public List<Task> batchPollTasksInDomain(

@Override
public void updateTask(TaskResult taskResult) {
taskResourceApi.updateTask(taskResult);
if(apiClient.isUseGRPC()) {
grpcTaskClient.updateTask(taskResult);
} else {
taskResourceApi.updateTask(taskResult);
}
}

@Override
Expand Down
4 changes: 1 addition & 3 deletions src/test/java/io/orkes/conductor/client/LoadTestWorker.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,11 @@

import java.security.SecureRandom;
import java.util.UUID;
import java.util.concurrent.TimeUnit;

import com.netflix.conductor.client.worker.Worker;
import com.netflix.conductor.common.metadata.tasks.Task;
import com.netflix.conductor.common.metadata.tasks.TaskResult;

import com.google.common.util.concurrent.Uninterruptibles;
import lombok.extern.slf4j.Slf4j;

@Slf4j
Expand All @@ -44,7 +42,7 @@ public TaskResult execute(Task task) {
log.info("Executing {} - {}", task.getTaskType(), task.getTaskId());
TaskResult result = new TaskResult(task);

Uninterruptibles.sleepUninterruptibly(400, TimeUnit.MILLISECONDS);
//Uninterruptibles.sleepUninterruptibly(10000, TimeUnit.MILLISECONDS);

result.setStatus(TaskResult.Status.COMPLETED);
int resultCount = Math.max(20, secureRandom.nextInt(keyCount));
Expand Down
7 changes: 5 additions & 2 deletions src/test/java/io/orkes/conductor/client/LocalWorkerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,18 @@ public class LocalWorkerTest {

public static void main(String[] args) {
ApiClient apiClient = new ApiClient("http://localhost:8080/api");
//apiClient.setUseGRPC("localhost", 8090);
apiClient.setUseGRPC("localhost", 8090);

OrkesClients clients = new OrkesClients(apiClient);
TaskClient taskClient = clients.getTaskClient();

List<Worker> workers = new ArrayList<>();
Map<String, Integer> taskThreadCount = new HashMap<>();

for (int i = 1; i <= 2; i++) {
workers.add(new LoadTestWorker("x_test_worker_4"));
taskThreadCount.put("x_test_worker_4", 1000);

for (int i = 0; i < 0; i++) {
workers.add(new LoadTestWorker("x_test_worker_" + i));
taskThreadCount.put("x_test_worker_" + i, 100);
}
Expand Down

0 comments on commit e75df9b

Please sign in to comment.