Skip to content

Commit 22643a8

Browse files
DanySKCopilot
andcommitted
Update alchemist-incarnation-sapere/src/test/java/it/unibo/alchemist/model/sapere/nodes/LsaNodeConcurrencyTest.java
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 58f6cfc commit 22643a8

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

alchemist-incarnation-sapere/src/test/java/it/unibo/alchemist/model/sapere/nodes/LsaNodeConcurrencyTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,14 @@ void testConcurrentGetContentsAndModification() throws InterruptedException {
108108
}
109109
} finally {
110110
executor.shutdownNow();
111+
try {
112+
if (!executor.awaitTermination(TIMEOUT_SECONDS, TimeUnit.SECONDS)) {
113+
throw new AssertionError("Executor did not terminate within " + TIMEOUT_SECONDS + " seconds");
114+
}
115+
} catch (final InterruptedException e) {
116+
Thread.currentThread().interrupt();
117+
throw new AssertionError("Interrupted while waiting for executor termination", e);
118+
}
111119
}
112120
// Verify the node is still in a valid state
113121
final Map<Molecule, List<ILsaMolecule>> finalContents = node.getContents();

0 commit comments

Comments
 (0)