Skip to content

Commit

Permalink
Fix failing tests
Browse files Browse the repository at this point in the history
Signed-off-by: Paolo Di Tommaso <[email protected]>
  • Loading branch information
pditommaso committed Nov 26, 2024
1 parent c375659 commit 1ded1ea
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ package io.seqera.wave.service.aws
import spock.lang.Requires
import spock.lang.Specification

import java.util.concurrent.Executors


/**
*
Expand All @@ -35,7 +37,7 @@ class AwsEcrServiceTest extends Specification {
def accessKey = System.getenv('AWS_ACCESS_KEY_ID')
def secretKey = System.getenv('AWS_SECRET_ACCESS_KEY')
def REGION = 'eu-west-1'
def provider = new AwsEcrService()
def provider = new AwsEcrService(ioExecutor: Executors.newCachedThreadPool())

when:
def creds = provider.getLoginToken(accessKey, secretKey, REGION, false).tokenize(":")
Expand All @@ -51,7 +53,7 @@ class AwsEcrServiceTest extends Specification {

def 'should check registry info' () {
given:
def provider = new AwsEcrService()
def provider = new AwsEcrService(ioExecutor: Executors.newCachedThreadPool())
expect:
provider.getEcrHostInfo(null) == null
provider.getEcrHostInfo('foo') == null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,17 @@ import spock.lang.Specification

import java.time.Duration
import java.util.concurrent.CompletableFuture
import java.util.concurrent.ExecutorService
import java.util.concurrent.TimeUnit

import io.micronaut.scheduling.TaskExecutors
import io.micronaut.test.extensions.spock.annotation.MicronautTest
import io.seqera.wave.service.pairing.socket.PairingOutboundQueue
import io.seqera.wave.service.pairing.socket.msg.PairingHeartbeat
import io.seqera.wave.service.pairing.socket.msg.PairingMessage
import jakarta.inject.Inject
import jakarta.inject.Named

/**
* Test class {@link AbstractMessageQueue} using a {@link io.seqera.wave.service.data.queue.impl.LocalMessageQueue}
*
Expand All @@ -40,9 +44,12 @@ class AbstractMessageQueueLocalTest extends Specification {
@Inject
private MessageQueue<String> broker

@Named(TaskExecutors.BLOCKING)
private ExecutorService ioExecutor

def 'should send and consume a request'() {
given:
def queue = new PairingOutboundQueue(broker, Duration.ofMillis(100))
def queue = new PairingOutboundQueue(broker, Duration.ofMillis(100), ioExecutor)

when:
def result = new CompletableFuture<PairingMessage>()
Expand All @@ -58,7 +65,7 @@ class AbstractMessageQueueLocalTest extends Specification {

def 'should validate '() {
given:
def queue = new PairingOutboundQueue(broker, Duration.ofMillis(100))
def queue = new PairingOutboundQueue(broker, Duration.ofMillis(100), ioExecutor)

expect:
queue.targetKey('foo') == 'pairing-outbound-queue/v1:foo'
Expand All @@ -68,6 +75,4 @@ class AbstractMessageQueueLocalTest extends Specification {
queue.close()
}



}

0 comments on commit 1ded1ea

Please sign in to comment.