Commit 7116c84
fix(test): isolate config discovery in server-spawning integration tests (#367)
* fix(test): isolate config discovery in server-spawning integration tests
json-rpc-integration and http-bind-host spawn the server with DSN set,
but the server discovers ./dbhub.toml relative to its own cwd and TOML
config outranks the DSN env var. Running from the repo root meant DSN was
silently ignored and the server tried to connect to whatever the local
dbhub.toml named, died, and never bound its port — surfacing as an opaque
"Server did not start within expected time".
Since dbhub.toml is gitignored, this reproduced only for developers who
have one, and never in CI.
Both tests now spawn from an empty temp directory. json-rpc also switches
from `pnpm dev` to invoking tsx directly, matching http-bind-host: `pnpm
dev` starts the Vite frontend alongside the backend under concurrently,
which was unnecessary and leaked a stray dev server on every run.
Also captures server output into the startup failure message, which
previously reported a bare timeout with no indication of the cause, and
adds a guard asserting the DSN config source was used.
json-rpc runtime drops from ~25s to ~1.1s.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(test): clear the SIGKILL timer on normal server exit
json-rpc's afterAll left the 5s kill timer pending when the server exited
cleanly. http-bind-host already clears it; this makes the two consistent
and removes a latent hazard if the pool ever stops force-exiting workers.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 0769813 commit 7116c84
2 files changed
Lines changed: 66 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
17 | 25 | | |
18 | 26 | | |
19 | 27 | | |
20 | 28 | | |
21 | 29 | | |
| 30 | + | |
22 | 31 | | |
23 | 32 | | |
24 | 33 | | |
| |||
76 | 85 | | |
77 | 86 | | |
78 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
79 | 91 | | |
80 | 92 | | |
81 | 93 | | |
82 | 94 | | |
83 | 95 | | |
84 | 96 | | |
85 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
86 | 105 | | |
87 | 106 | | |
88 | 107 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
17 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
18 | 27 | | |
19 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
20 | 35 | | |
21 | | - | |
| 36 | + | |
| 37 | + | |
22 | 38 | | |
23 | 39 | | |
24 | 40 | | |
| |||
29 | 45 | | |
30 | 46 | | |
31 | 47 | | |
32 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
33 | 51 | | |
34 | | - | |
| 52 | + | |
35 | 53 | | |
36 | 54 | | |
37 | 55 | | |
38 | | - | |
| 56 | + | |
39 | 57 | | |
40 | 58 | | |
41 | 59 | | |
| |||
65 | 83 | | |
66 | 84 | | |
67 | 85 | | |
68 | | - | |
| 86 | + | |
69 | 87 | | |
70 | 88 | | |
71 | 89 | | |
| |||
104 | 122 | | |
105 | 123 | | |
106 | 124 | | |
107 | | - | |
| 125 | + | |
108 | 126 | | |
109 | | - | |
110 | | - | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
111 | 130 | | |
112 | 131 | | |
113 | 132 | | |
114 | | - | |
| 133 | + | |
115 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
116 | 139 | | |
117 | | - | |
| 140 | + | |
118 | 141 | | |
119 | 142 | | |
120 | 143 | | |
| |||
123 | 146 | | |
124 | 147 | | |
125 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
126 | 154 | | |
127 | 155 | | |
128 | 156 | | |
| |||
151 | 179 | | |
152 | 180 | | |
153 | 181 | | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
154 | 189 | | |
155 | 190 | | |
156 | 191 | | |
| |||
0 commit comments