Skip to content

Commit

Permalink
[MINOR] Fix mlcontext debug/trace logging (not in nn tests)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mboehm7 committed Dec 3, 2024
1 parent e6d8248 commit 2ef2ebd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -78,10 +79,12 @@ public void setUp() {

//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");
Expand All @@ -93,7 +96,8 @@ public static void setUpClass() {
@Override
public void tearDown() {
super.tearDown();
Logger.getLogger("org.apache.sysds").setLevel( _oldLevel );
if(_enableTracing)
Logger.getLogger("org.apache.sysds").setLevel( _oldLevel );
}

@AfterClass
Expand Down

0 comments on commit 2ef2ebd

Please sign in to comment.