Skip to content

Commit 1782965

Browse files
Alexander Kiselevclaude
andcommitted
fix: Use long-running fixture for pause/resume test
The previous pause/resume test used simple.c which completes too fast to pause reliably. Changed to use attach_target.c which runs for 30 seconds, giving plenty of time to test the pause functionality. Also modified the test to use "stop" command at the end instead of waiting for the program to exit, to avoid waiting 30 seconds for the test to complete. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 77e1112 commit 1782965

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

tests/scenarios/pause_resume_c.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,51 @@
11
# Pause/Resume Test (C)
22
# Tests pause command to stop running program
3-
# Uses factorial breakpoint to ensure program runs long enough for reliable pause
3+
# Uses attach_target fixture which runs long enough to reliably pause
44

55
name: "C Pause/Resume Test"
66
description: "Verifies pause command stops a running program"
77

88
setup:
9-
- shell: "gcc -g tests/fixtures/simple.c -o tests/fixtures/test_simple_c"
9+
- shell: "gcc -g tests/fixtures/attach_target.c -o tests/fixtures/test_attach_target"
1010

1111
target:
12-
program: "../fixtures/test_simple_c"
12+
program: "../fixtures/test_attach_target"
1313
args: []
1414
stop_on_entry: true
1515

1616
steps:
17-
# Set breakpoint in factorial to ensure we can pause during computation
17+
# Set breakpoint in main loop to verify we can reach that code
1818
- action: command
19-
command: "break factorial"
19+
command: "break main"
2020
expect:
2121
success: true
2222

2323
- action: command
2424
command: "continue"
2525

26-
# Wait for first factorial hit
26+
# Wait for breakpoint in main
2727
- action: await
2828
timeout: 10
2929
expect:
3030
reason: "breakpoint"
3131

32-
# Remove breakpoint and continue - program will run through factorial(5)
32+
# Remove all breakpoints and continue - program will start its 30-second loop
3333
- action: command
34-
command: "breakpoint remove --all"
34+
command: "breakpoint remove all"
35+
expect:
36+
success: true
3537

3638
- action: command
3739
command: "continue"
3840

39-
# Immediately pause - factorial recursion should still be running
41+
# Pause the running program
4042
- action: command
4143
command: "pause"
4244
expect:
4345
success: true
4446

4547
- action: await
46-
timeout: 5
48+
timeout: 10
4749
expect:
4850
reason: "pause"
4951

@@ -53,10 +55,8 @@ steps:
5355
expect:
5456
success: true
5557

58+
# Stop the debug session (don't wait for 30-second program to complete)
5659
- action: command
57-
command: "continue"
58-
59-
- action: await
60-
timeout: 10
60+
command: "stop"
6161
expect:
62-
reason: "exited"
62+
success: true

0 commit comments

Comments
 (0)