This is an automated email from the ASF dual-hosted git repository.
mboehm7 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/systemds.git
The following commit(s) were added to refs/heads/main by this push:
new 2ef2ebda85 [MINOR] Fix mlcontext debug/trace logging (not in nn tests)
2ef2ebda85 is described below
commit 2ef2ebda85f1115cb89bc8ca86768fa4852ab0e7
Author: Matthias Boehm <[email protected]>
AuthorDate: Tue Dec 3 12:07:52 2024 +0100
[MINOR] Fix mlcontext debug/trace logging (not in nn tests)
This patch fixes the recently enabled debug/trace logging in mlcontext
because the application tests timeout. Unfortunately, the nn tests
(in applications) inherit from the mlcontext tests and these nn tests
execute a log of tiny mini-batch operations where the log output is
just way too large.
---
.../org/apache/sysds/test/applications/nn/BaseTest.java | 5 +++++
.../sysds/test/functions/mlcontext/MLContextTestBase.java | 14 +++++++++-----
2 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/src/test/java/org/apache/sysds/test/applications/nn/BaseTest.java
b/src/test/java/org/apache/sysds/test/applications/nn/BaseTest.java
index 2fa9f55679..f8b33fdc3e 100644
--- a/src/test/java/org/apache/sysds/test/applications/nn/BaseTest.java
+++ b/src/test/java/org/apache/sysds/test/applications/nn/BaseTest.java
@@ -32,6 +32,11 @@ public abstract class BaseTest extends MLContextTestBase {
private static final String ERROR_STRING = "ERROR:";
+ public BaseTest() {
+ //disable debug and trace logging in mlcontext super class since
+ //the nn tests execute a lot of mini-batch operations
+ _enableTracing = false;
+ }
protected void run(String name) {
run(name, false);
diff --git
a/src/test/java/org/apache/sysds/test/functions/mlcontext/MLContextTestBase.java
b/src/test/java/org/apache/sysds/test/functions/mlcontext/MLContextTestBase.java
index 6b5df523f5..b21bcaf54c 100644
---
a/src/test/java/org/apache/sysds/test/functions/mlcontext/MLContextTestBase.java
+++
b/src/test/java/org/apache/sysds/test/functions/mlcontext/MLContextTestBase.java
@@ -66,7 +66,8 @@ public abstract class MLContextTestBase extends
AutomatedTestBase {
protected String testDir = null;
protected String testName = null;
protected Level _oldLevel = null;
-
+ protected boolean _enableTracing = true;
+
@Override
public void setUp() {
Class<? extends MLContextTestBase> clazz = this.getClass();
@@ -78,10 +79,12 @@ public abstract class MLContextTestBase extends
AutomatedTestBase {
//run all mlcontext tests in loglevel trace to improve test
coverage
//of all logging in various components
- _oldLevel = Logger.getLogger("org.apache.sysds").getLevel();
- Logger.getLogger("org.apache.sysds").setLevel( Level.TRACE );
+ if( _enableTracing ) {
+ _oldLevel =
Logger.getLogger("org.apache.sysds").getLevel();
+ Logger.getLogger("org.apache.sysds").setLevel(
Level.TRACE );
+ }
}
-
+
@BeforeClass
public static void setUpClass() {
spark = createSystemDSSparkSession("SystemDS MLContext Test",
"local");
@@ -93,7 +96,8 @@ public abstract class MLContextTestBase extends
AutomatedTestBase {
@Override
public void tearDown() {
super.tearDown();
- Logger.getLogger("org.apache.sysds").setLevel( _oldLevel );
+ if(_enableTracing)
+ Logger.getLogger("org.apache.sysds").setLevel(
_oldLevel );
}
@AfterClass