From c4712981a9649162fc63cabfa6c1318da5adc42e Mon Sep 17 00:00:00 2001 From: Etienne LESOT Date: Mon, 3 Aug 2026 16:52:58 +0200 Subject: [PATCH 1/2] do not emit all computation status when unbuilding node Signed-off-by: Etienne LESOT --- .../java/org/gridsuite/study/server/service/StudyService.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/org/gridsuite/study/server/service/StudyService.java b/src/main/java/org/gridsuite/study/server/service/StudyService.java index e09795b523..8447e5eca7 100644 --- a/src/main/java/org/gridsuite/study/server/service/StudyService.java +++ b/src/main/java/org/gridsuite/study/server/service/StudyService.java @@ -1730,7 +1730,6 @@ private void invalidateNode(UUID studyUuid, UUID nodeUuid, UUID rootNetworkUuid) invalidateNodeInfos.setNetworkUuid(rootNetworkService.getNetworkUuid(rootNetworkUuid)); deleteInvalidationInfos(invalidateNodeInfos); - emitAllComputationStatusChanged(studyUuid, nodeUuid, rootNetworkUuid, InvalidateNodeTreeParameters.ComputationsInvalidationMode.ALL); if (startTime.get() != null) { LOGGER.trace("unbuild node '{}' of study '{}' : {} seconds", nodeUuid, studyUuid, From 1f3455e6c41d84aad089a155c3b3816cebd03289 Mon Sep 17 00:00:00 2001 From: Etienne LESOT Date: Tue, 4 Aug 2026 08:22:52 +0200 Subject: [PATCH 2/2] correct tests Signed-off-by: Etienne LESOT --- .../study/server/NetworkModificationUnitTest.java | 1 - .../server/studycontroller/NodeControllerTest.java | 13 ++++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/test/java/org/gridsuite/study/server/NetworkModificationUnitTest.java b/src/test/java/org/gridsuite/study/server/NetworkModificationUnitTest.java index ef50a603c0..a714b67bd0 100644 --- a/src/test/java/org/gridsuite/study/server/NetworkModificationUnitTest.java +++ b/src/test/java/org/gridsuite/study/server/NetworkModificationUnitTest.java @@ -175,7 +175,6 @@ void unbuildNode() { assertNodeBuildStatus(node3Uuid, BuildStatus.NOT_BUILT); assertNodeBuildStatus(node4Uuid, BuildStatus.BUILT); checkUpdateBuildStateMessageReceived(studyUuid, List.of(node1Uuid)); - checkUpdateStatusMessagesReceived(studyUuid, node1Uuid, output); checkElementUpdatedMessageSent(studyUuid, USER_ID_HEADER); Mockito.verify(networkService).deleteVariants(NETWORK_UUID, List.of(VARIANT_1)); diff --git a/src/test/java/org/gridsuite/study/server/studycontroller/NodeControllerTest.java b/src/test/java/org/gridsuite/study/server/studycontroller/NodeControllerTest.java index a64c2453b5..e0fe9f7683 100644 --- a/src/test/java/org/gridsuite/study/server/studycontroller/NodeControllerTest.java +++ b/src/test/java/org/gridsuite/study/server/studycontroller/NodeControllerTest.java @@ -271,7 +271,7 @@ void testCutAndPasteNodeWithoutModification() throws Exception { UUID stubDeleteReportsId = wireMockServer.stubFor(WireMock.delete(WireMock.urlPathEqualTo("/v1/reports")) .willReturn(WireMock.ok())).getId(); - cutAndPasteNode(study1Uuid, emptyNode, node1.getId(), InsertMode.BEFORE, 1, userId); + cutAndPasteNode(study1Uuid, emptyNode, node1.getId(), InsertMode.BEFORE, 1, userId, false); wireMockStubs.verifyDeleteReports(stubDeleteReportsId, 1); @@ -414,8 +414,13 @@ void testCutAndPasteSubtree() throws Exception { .header(USER_ID_HEADER, "userId")).andExpect(status().isNotFound()); } - @SuppressWarnings("checkstyle:LambdaBodyLength") private void cutAndPasteNode(UUID studyUuid, NetworkModificationNode nodeToCopy, UUID referenceNodeUuid, InsertMode insertMode, int childCount, String userId) throws Exception { + cutAndPasteNode(studyUuid, nodeToCopy, referenceNodeUuid, insertMode, childCount, userId, true); + } + + @SuppressWarnings("checkstyle:LambdaBodyLength") + private void cutAndPasteNode(UUID studyUuid, NetworkModificationNode nodeToCopy, UUID referenceNodeUuid, + InsertMode insertMode, int childCount, String userId, boolean checkComputationStatus) throws Exception { UUID stubUuid = wireMockStubs.stubNetworkModificationCountGet(nodeToCopy.getModificationGroupUuid().toString(), EMPTY_MODIFICATION_GROUP_UUID.equals(nodeToCopy.getModificationGroupUuid()) ? 0 : 1); boolean wasBuilt = rootNetworkNodeInfoService.getRootNetworkNodeInfo(nodeToCopy.getId(), studyTestUtils.getOneRootNetworkUuid(studyUuid)).get().getNodeBuildStatus().toDto().isBuilt(); @@ -451,7 +456,9 @@ private void cutAndPasteNode(UUID studyUuid, NetworkModificationNode nodeToCopy, if (wasBuilt) { assertNotNull(output.receive(TIMEOUT, studyUpdateDestination)); } - checkComputationStatusMessageReceived(); + if (checkComputationStatus) { + checkComputationStatusMessageReceived(); + } if (!nodeHasModifications) { return;