From 916f00145d6bf575e05cbc7f6dffbccf96c0372e Mon Sep 17 00:00:00 2001 From: Gunnar Velle Date: Wed, 13 Sep 2023 09:01:11 +0200 Subject: [PATCH] Do not wait for async function since async is disabled in test. --- .../service/NodePublishingIntegrationTest.java | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/test/java/no/ndla/taxonomy/service/NodePublishingIntegrationTest.java b/src/test/java/no/ndla/taxonomy/service/NodePublishingIntegrationTest.java index 48a21ab0..e8a6ed7f 100644 --- a/src/test/java/no/ndla/taxonomy/service/NodePublishingIntegrationTest.java +++ b/src/test/java/no/ndla/taxonomy/service/NodePublishingIntegrationTest.java @@ -98,7 +98,6 @@ void can_publish_node_to_schema() throws Exception { TestTransaction.end(); nodeService.publishNode(node.getPublicId(), Optional.empty(), target.getPublicId(), false, false); - executor.getThreadPoolExecutor().awaitTermination(6, TimeUnit.SECONDS); while (!changelogRepository.findAll().isEmpty()) { executor.getThreadPoolExecutor().awaitTermination(2, TimeUnit.SECONDS); @@ -163,7 +162,6 @@ void can_publish_node_with_resource_to_schema() throws Exception { TestTransaction.end(); nodeService.publishNode(node.getPublicId(), Optional.empty(), target.getPublicId(), false, false); - executor.getThreadPoolExecutor().awaitTermination(6, TimeUnit.SECONDS); while (!changelogRepository.findAll().isEmpty()) { executor.getThreadPoolExecutor().awaitTermination(2, TimeUnit.SECONDS); @@ -226,7 +224,6 @@ void can_publish_sub_node_with_resource_to_schema() throws Exception { TestTransaction.end(); nodeService.publishNode(node.getPublicId(), Optional.empty(), target.getPublicId(), false, false); - executor.getThreadPoolExecutor().awaitTermination(6, TimeUnit.SECONDS); while (!changelogRepository.findAll().isEmpty()) { executor.getThreadPoolExecutor().awaitTermination(2, TimeUnit.SECONDS); @@ -269,7 +266,6 @@ void can_publish_node_tree_with_resources_to_schema() throws Exception { TestTransaction.end(); nodeService.publishNode(node.getPublicId(), Optional.empty(), target.getPublicId(), false, false); - executor.getThreadPoolExecutor().awaitTermination(6, TimeUnit.SECONDS); while (!changelogRepository.findAll().isEmpty()) { executor.getThreadPoolExecutor().awaitTermination(2, TimeUnit.SECONDS); @@ -329,7 +325,6 @@ void can_publish_node_tree_with_reused_resource_to_schema() throws Exception { TestTransaction.end(); nodeService.publishNode(node.getPublicId(), Optional.empty(), target.getPublicId(), false, false); - executor.getThreadPoolExecutor().awaitTermination(6, TimeUnit.SECONDS); while (!changelogRepository.findAll().isEmpty()) { executor.getThreadPoolExecutor().awaitTermination(2, TimeUnit.SECONDS); @@ -383,7 +378,6 @@ void can_publish_node_in_tree_to_schema() throws Exception { TestTransaction.end(); nodeService.publishNode(node.getPublicId(), Optional.empty(), target.getPublicId(), false, false); - executor.getThreadPoolExecutor().awaitTermination(6, TimeUnit.SECONDS); while (!changelogRepository.findAll().isEmpty()) { executor.getThreadPoolExecutor().awaitTermination(2, TimeUnit.SECONDS); @@ -431,9 +425,7 @@ void can_publish_node_tree_with_reused_resource_twice_to_schema() throws Excepti TestTransaction.end(); nodeService.publishNode(node.getPublicId(), Optional.empty(), target.getPublicId(), false, false); - executor.getThreadPoolExecutor().awaitTermination(2, TimeUnit.SECONDS); nodeService.publishNode(second.getPublicId(), Optional.empty(), target.getPublicId(), false, false); - executor.getThreadPoolExecutor().awaitTermination(6, TimeUnit.SECONDS); while (!changelogRepository.findAll().isEmpty()) { executor.getThreadPoolExecutor().awaitTermination(2, TimeUnit.SECONDS); @@ -494,7 +486,6 @@ void can_publish_reused_resource_with_translations_to_schema() throws Exception TestTransaction.end(); nodeService.publishNode(node.getPublicId(), Optional.empty(), target.getPublicId(), false, false); - executor.getThreadPoolExecutor().awaitTermination(6, TimeUnit.SECONDS); while (!changelogRepository.findAll().isEmpty()) { executor.getThreadPoolExecutor().awaitTermination(2, TimeUnit.SECONDS); @@ -517,7 +508,6 @@ void can_publish_reused_resource_with_translations_to_schema() throws Exception TestTransaction.end(); nodeService.publishNode(second.getPublicId(), Optional.empty(), target.getPublicId(), false, false); - executor.getThreadPoolExecutor().awaitTermination(6, TimeUnit.SECONDS); while (!changelogRepository.findAll().isEmpty()) { executor.getThreadPoolExecutor().awaitTermination(2, TimeUnit.SECONDS); @@ -574,7 +564,6 @@ void can_publish_node_twice_to_schema() throws Exception { TestTransaction.end(); nodeService.publishNode(node.getPublicId(), Optional.empty(), target.getPublicId(), false, false); - executor.getThreadPoolExecutor().awaitTermination(6, TimeUnit.SECONDS); while (!changelogRepository.findAll().isEmpty()) { executor.getThreadPoolExecutor().awaitTermination(2, TimeUnit.SECONDS); @@ -595,7 +584,6 @@ void can_publish_node_twice_to_schema() throws Exception { TestTransaction.end(); nodeService.publishNode(node.getPublicId(), Optional.empty(), target.getPublicId(), false, false); - executor.getThreadPoolExecutor().awaitTermination(6, TimeUnit.SECONDS); while (!changelogRepository.findAll().isEmpty()) { executor.getThreadPoolExecutor().awaitTermination(1, TimeUnit.SECONDS); @@ -647,7 +635,6 @@ void can_publish_node_tree_to_schema_async() throws Exception { TestTransaction.end(); nodeService.publishNode(node.getPublicId(), Optional.empty(), target.getPublicId(), true, false); - executor.getThreadPoolExecutor().awaitTermination(6, TimeUnit.SECONDS); while (!changelogRepository.findAll().isEmpty()) { executor.getThreadPoolExecutor().awaitTermination(2, TimeUnit.SECONDS);