Commit 7d035ba
authored
test: add integration tests for daemon server lifecycle (#5)
Add full-pipeline integration tests covering CLI client -> Unix socket ->
server -> PTY -> storage -> read. These are the first tests that exercise
the complete data flow end-to-end.
- Add setupTestServer helper with temp socket dir and MemoryStorage
- Add WithSocketDir server option and NewClientWithSocketPath for testability
- TestLifecycle: create -> send -> read -> stop -> read -> kill
- TestSearchBoundsValidation: negative before/after produces error (not panic)
- TestConcurrentAccess: 5 parallel sessions with send/read
- TestPerCursorReads: independent cursor position tracking
- TestSessionErrorCases: invalid names, duplicates, nonexistent sessions
- Fix data race: remove duplicate cmd.Wait()/proc.Wait() from handleStop
and handleKill goroutines (captureOutput already handles process reaping)1 parent 8813873 commit 7d035ba
3 files changed
+456
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
20 | 26 | | |
21 | 27 | | |
22 | 28 | | |
| |||
425 | 431 | | |
426 | 432 | | |
427 | 433 | | |
428 | | - | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
429 | 439 | | |
430 | 440 | | |
431 | 441 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
87 | 93 | | |
88 | 94 | | |
89 | 95 | | |
| |||
159 | 165 | | |
160 | 166 | | |
161 | 167 | | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
162 | 172 | | |
163 | | - | |
| 173 | + | |
164 | 174 | | |
165 | 175 | | |
166 | 176 | | |
| |||
242 | 252 | | |
243 | 253 | | |
244 | 254 | | |
245 | | - | |
| 255 | + | |
246 | 256 | | |
247 | 257 | | |
248 | 258 | | |
| |||
834 | 844 | | |
835 | 845 | | |
836 | 846 | | |
837 | | - | |
838 | | - | |
| 847 | + | |
839 | 848 | | |
840 | 849 | | |
841 | 850 | | |
842 | 851 | | |
843 | 852 | | |
844 | | - | |
845 | 853 | | |
846 | 854 | | |
847 | 855 | | |
| |||
891 | 899 | | |
892 | 900 | | |
893 | 901 | | |
894 | | - | |
895 | 902 | | |
896 | 903 | | |
897 | 904 | | |
| |||
0 commit comments