From dfeb0b6fa64c6781d93fd161bf9f616ecd7c6caa Mon Sep 17 00:00:00 2001 From: axexlck Date: Sun, 10 Nov 2024 02:43:24 +0100 Subject: [PATCH] wait for `Rubi` context to be initialized in JUnit `FileFunctionsTest` --- .../core/system/FileFunctionsTest.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/symja_android_library/matheclipse-core/src/test/java/org/matheclipse/core/system/FileFunctionsTest.java b/symja_android_library/matheclipse-core/src/test/java/org/matheclipse/core/system/FileFunctionsTest.java index 3fd95e954b..004ddda35f 100644 --- a/symja_android_library/matheclipse-core/src/test/java/org/matheclipse/core/system/FileFunctionsTest.java +++ b/symja_android_library/matheclipse-core/src/test/java/org/matheclipse/core/system/FileFunctionsTest.java @@ -2,9 +2,26 @@ import org.junit.Test; import org.matheclipse.core.basic.Config; +import org.matheclipse.core.expression.F; +import org.matheclipse.core.expression.S; public class FileFunctionsTest extends ExprEvaluatorTestCase { + @Override + public void setUp() { + super.setUp(); + try { + F.initSymbols(); + F.await(); + // wait especially for Rubi` context to be initialized otherwise + // java.util.ConcurrentModificationException can occur in saving Global` context in + // testSaveGlobalContext() + S.Integrate.getEvaluator().await(); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + @Test public void testSave() { Config.FILESYSTEM_ENABLED = true;