Skip to content

Commit

Permalink
#334 - Re-enable CodeableConceptServiceIT (#417)
Browse files Browse the repository at this point in the history
* #334 - Re-enable CodeableConceptServiceIT

- Update elastic search to 8.16.1
- add a 1s delay after uploading test data to elastic since it seems to have been a timing problem
  • Loading branch information
michael-82 authored Dec 12, 2024
1 parent 7944fa2 commit 28392e5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/integration-test/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ services:
POSTGRES_DB: "dataportal"

dataportal-elastic:
image: docker.elastic.co/elasticsearch/elasticsearch:8.16.0
image: docker.elastic.co/elasticsearch/elasticsearch:8.16.1
container_name: dataportal-elastic
ports:
- '9200:9200'
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ services:
source: dataportal-postgres-data
target: /var/lib/postgresql/data
dataportal-elastic:
image: docker.elastic.co/elasticsearch/elasticsearch:8.16.0
image: docker.elastic.co/elasticsearch/elasticsearch:8.16.1
container_name: dataportal-elastic
ports:
- '9200:9200'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertNotNull;

@Disabled("There seems to be a concurrency issue with TerminologyServiceIT. Disable this for now until it is fixed.")
@Tag("terminology")
@Tag("elasticsearch")
@Import({CodeableConceptService.class})
Expand All @@ -46,7 +45,7 @@ public class CodeableConceptServiceIT {

@Container
@ServiceConnection
public static ElasticsearchContainer ELASTICSEARCH_CONTAINER = new ElasticsearchContainer("docker.elastic.co/elasticsearch/elasticsearch:8.16.0")
public static ElasticsearchContainer ELASTICSEARCH_CONTAINER = new ElasticsearchContainer("docker.elastic.co/elasticsearch/elasticsearch:8.16.1")
.withEnv("discovery.type", "single-node")
.withEnv("xpack.security.enabled", "false")
.withReuse(false)
Expand All @@ -56,7 +55,7 @@ public class CodeableConceptServiceIT {
.waitingFor(Wait.forHttp("/health").forStatusCodeMatching(c -> c >= 200 && c <= 500));

@BeforeAll
static void setUp() {
static void setUp() throws InterruptedException {
ELASTICSEARCH_CONTAINER.start();
WebClient webClient = WebClient.builder().baseUrl("http://" + ELASTICSEARCH_CONTAINER.getHttpHostAddress()).build();
webClient.put()
Expand All @@ -72,6 +71,9 @@ static void setUp() {
.retrieve()
.toBodilessEntity()
.block();

// When running in github actions without a slight delay, the data might not be complete in the elastic search container (although a blocking call is used)
Thread.sleep(1000);
}

@AfterAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class TerminologyEsServiceIT {

@Container
@ServiceConnection
public static ElasticsearchContainer ELASTICSEARCH_CONTAINER = new ElasticsearchContainer("docker.elastic.co/elasticsearch/elasticsearch:8.16.0")
public static ElasticsearchContainer ELASTICSEARCH_CONTAINER = new ElasticsearchContainer("docker.elastic.co/elasticsearch/elasticsearch:8.16.1")
.withEnv("discovery.type", "single-node")
.withEnv("xpack.security.enabled", "false")
.withReuse(false)
Expand Down

0 comments on commit 28392e5

Please sign in to comment.