Skip to content

Commit bb88511

Browse files
committed
Fix SteppingTest isolation: per-test DAP connections
1 parent fa14e9b commit bb88511

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

test/cfml/SteppingTest.cfc

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,20 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="dap" {
2222
};
2323

2424
function beforeAll() {
25-
setupDap();
25+
// Set up paths only - DAP connection happens per-test to ensure isolation
26+
variables.dapHost = server.system.environment.DAP_HOST ?: "localhost";
27+
variables.dapPort = val( server.system.environment.DAP_PORT ?: 10000 );
28+
variables.debuggeeHttp = server.system.environment.DEBUGGEE_HTTP ?: "http://localhost:8888";
29+
variables.debuggeeArtifactPath = server.system.environment.DEBUGGEE_ARTIFACT_PATH ?: "";
30+
variables.dapSecret = server.system.environment.DAP_SECRET ?: "testing";
2631
variables.targetFile = getArtifactPath( "stepping-target.cfm" );
2732
}
2833

34+
function beforeEach() {
35+
// Fresh DAP connection for each test - disconnect clears any stuck threads via continueAll()
36+
setupDap();
37+
}
38+
2939
// Validate our line number assumptions using breakpointLocations (native mode only)
3040
function testValidateLineNumbers_steppingTarget() skip="notSupportsBreakpointLocations" {
3141
var locations = dap.breakpointLocations( variables.targetFile, 1, 35 );
@@ -41,8 +51,8 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="dap" {
4151

4252
function afterEach() {
4353
clearBreakpoints( variables.targetFile );
44-
// Drain any stale events from previous test
45-
dap.drainEvents();
54+
// Disconnect after each test - this triggers continueAll() on server, resuming stuck threads
55+
teardownDap();
4656
}
4757

4858
// ========== Step Over ==========

0 commit comments

Comments
 (0)