Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.function.Function;
import java.util.stream.Collectors;
import lombok.SneakyThrows;
Expand Down Expand Up @@ -120,9 +118,6 @@ public class TestCaseRepository extends EntityRepository<TestCase> {
private static final String PATCH_FIELDS =
"owners,entityLink,testSuite,testSuites,testDefinition,computePassedFailedRowCount,useDynamicAssertion,dimensionColumns,topDimensions";
public static final String FAILED_ROWS_SAMPLE_EXTENSION = "testCase.failedRowsSample";
private final ExecutorService asyncExecutor =
Executors.newFixedThreadPool(
1, java.lang.Thread.ofPlatform().name("om-test-case-async").factory());

public TestCaseRepository() {
super(
Expand Down Expand Up @@ -896,18 +891,16 @@ private void updateLogicalTestSuite(UUID testSuiteId) {
protected void deleteChildren(
List<CollectionDAO.EntityRelationshipRecord> children, boolean hardDelete, String updatedBy) {
if (hardDelete) {
for (CollectionDAO.EntityRelationshipRecord entityRelationshipRecord : children) {
TestCaseResolutionStatusRepository testCaseResolutionStatusRepository =
(TestCaseResolutionStatusRepository)
Entity.getEntityTimeSeriesRepository(Entity.TEST_CASE_RESOLUTION_STATUS);
for (CollectionDAO.EntityRelationshipRecord child : children) {
LOG.info(
"Recursively {} deleting {} {}",
hardDelete ? "hard" : "soft",
entityRelationshipRecord.getType(),
entityRelationshipRecord.getId());
TestCaseResolutionStatusRepository testCaseResolutionStatusRepository =
(TestCaseResolutionStatusRepository)
Entity.getEntityTimeSeriesRepository(Entity.TEST_CASE_RESOLUTION_STATUS);
for (CollectionDAO.EntityRelationshipRecord child : children) {
testCaseResolutionStatusRepository.deleteById(child.getId(), hardDelete);
}
child.getType(),
child.getId());
testCaseResolutionStatusRepository.deleteById(child.getId(), hardDelete);
}
}
}
Expand All @@ -921,14 +914,6 @@ private void deleteAllTestCaseResults(String fqn) {
TestCaseResultRepository testCaseResultRepository =
(TestCaseResultRepository) Entity.getEntityTimeSeriesRepository(TEST_CASE_RESULT);
testCaseResultRepository.deleteAllTestCaseResults(fqn);
asyncExecutor.submit(
() -> {
try {
testCaseResultRepository.deleteAllTestCaseResults(fqn);
} catch (Exception e) {
LOG.error("Error deleting test case results for test case {}", fqn, e);
}
});
}

@SneakyThrows
Expand Down
Loading