Skip to content

Commit 7c5f7a8

Browse files
committed
Reset debugger after tests
1 parent f0a290e commit 7c5f7a8

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed

fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/query/plan/cascades/debug/DebuggerWithSymbolTablesTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import com.apple.foundationdb.record.query.plan.cascades.Reference;
2626
import com.apple.foundationdb.record.query.plan.cascades.expressions.SelectExpression;
2727
import com.apple.foundationdb.record.query.plan.cascades.values.LiteralValue;
28+
import org.junit.jupiter.api.AfterAll;
2829
import org.junit.jupiter.api.BeforeEach;
2930
import org.junit.jupiter.api.Test;
3031

@@ -49,6 +50,11 @@ void setUp() {
4950
setupDebugger();
5051
}
5152

53+
@AfterAll
54+
static void tearDown() {
55+
Debugger.setDebugger(null);
56+
}
57+
5258
@Test
5359
void testOnQueryResetsState() {
5460
final EventState initialEventState = debugger.getCurrentEventState();

fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/query/plan/cascades/debug/LightweightDebuggerTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import com.apple.foundationdb.record.query.plan.cascades.Reference;
2626
import com.apple.foundationdb.record.query.plan.cascades.expressions.SelectExpression;
2727
import com.apple.foundationdb.record.query.plan.cascades.values.LiteralValue;
28+
import org.junit.jupiter.api.AfterAll;
2829
import org.junit.jupiter.api.BeforeEach;
2930
import org.junit.jupiter.api.Test;
3031

@@ -45,6 +46,11 @@ void setUp() {
4546
StatsDebugger.withDebugger(d -> d.onQuery("SELECT * from A", PlanContext.EMPTY_CONTEXT));
4647
}
4748

49+
@AfterAll
50+
static void tearDown() {
51+
Debugger.setDebugger(null);
52+
}
53+
4854
@Test
4955
void testOnQueryResetsState() {
5056
final EventState initialState = debugger.getCurrentEventState();

fdb-record-layer-debugger/src/test/java/com/apple/foundationdb/record/query/plan/cascades/debug/CommandsTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import com.apple.foundationdb.record.query.plan.cascades.values.LiteralValue;
3030
import org.jline.terminal.Terminal;
3131
import org.jline.terminal.impl.DumbTerminal;
32+
import org.junit.jupiter.api.AfterAll;
3233
import org.junit.jupiter.api.BeforeEach;
3334
import org.junit.jupiter.api.Test;
3435

@@ -65,6 +66,11 @@ void setUp() throws IOException {
6566
Debugger.withDebugger(d -> d.onQuery(query, PlanContext.EMPTY_CONTEXT));
6667
}
6768

69+
@AfterAll
70+
static void tearDown() {
71+
Debugger.setDebugger(null);
72+
}
73+
6874
@Test
6975
void testBreakCommand() throws IOException {
7076
outIn.write("break rule somerule BEGIN\nbreak list\ncont\n".getBytes(StandardCharsets.UTF_8));

fdb-record-layer-debugger/src/test/java/com/apple/foundationdb/record/query/plan/cascades/debug/PlannerReplTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
import org.jline.terminal.Terminal;
3333
import org.jline.terminal.impl.DumbTerminal;
34+
import org.junit.jupiter.api.AfterAll;
3435
import org.junit.jupiter.api.BeforeEach;
3536
import org.junit.jupiter.api.Test;
3637

@@ -63,6 +64,11 @@ void setUp() throws IOException {
6364
Debugger.withDebugger(d -> d.onQuery("SELECT * FROM A", PlanContext.EMPTY_CONTEXT));
6465
}
6566

67+
@AfterAll
68+
static void tearDown() {
69+
Debugger.setDebugger(null);
70+
}
71+
6672
@Test
6773
void testOnQueryPrintsQueryAndCreatesNewState() throws IOException, InterruptedException {
6874
outIn.write("cont\n".getBytes(StandardCharsets.UTF_8));

0 commit comments

Comments
 (0)