Commit 793fe9c
fix(test): macOS local image, plugin tests, and test suite restructuring (#9610)
## Summary
This PR fixes macOS compatibility for local image builds and plugin
tests, restructures the test suite system for better ergonomics and
resource management, and fixes a flaky integration2 test.
### macOS / Local Build Fixes
- Enable CGO cross-compilation for plugin support on macOS (Darwin →
Linux)
- Fix integration test routing, `gotestsum` PATH resolution, and
cross-compilation issues
- Add cluster pause/resume and resilient restore waits for stability
- Resolve shellcheck SC2312 in `check-cross-compiler.sh`
### Test Suite Restructuring
- **New `integration` suite** (new default): runs everything except
`ldbc`, `load`, and `systest-heavy` — replaces old `unit,systest,core`
default
- **New `unit` suite behavior**: true unit tests only — no Docker
cluster, no `--tags=integration`, skips custom-cluster packages
- **New `systest-baseline` / `systest-heavy` sub-suites**: separates
lightweight systests from resource-intensive ones (minio, encryption,
tracing, online-restore) that can OOM on Docker
- `systest` still runs both sub-suites for backward compatibility
- **New Make targets**: `test-integration`, `test-integration-heavy`
- **Renamed**: `test-full` → `test-all`
- **Removed**: `test-suite`, `test-ldbc`, `test-load` (use `make test
SUITE=...` instead)
### Import Client Retry Fix
- **Fixed flaky `TestImportApis/SingleGroupShutOneAlpha`** in the
`dgraph-integration2-tests` CI job
- Root cause: `initiateSnapshotStream` made a single attempt to start
the snapshot stream, but the Dgraph server can return "overloaded with
pending proposals" during Raft membership changes (e.g., when an alpha
is shut down and the cluster is rebalancing)
- Fix: Added exponential backoff retry (1s → 10s cap, 60s max total) for
transient "overloaded" errors
- Only retries on "overloaded" — connectivity errors ("connection
refused", "unable to connect to the leader") still fail immediately so
negative test cases don't block unnecessarily
### Quick Reference
| Command | What it runs |
|---------|-------------|
| `make test` | `integration` suite + `integration2` (~30 min) |
| `make test-unit` | True unit tests — no Docker |
| `make test-integration` | Integration tests via t/ runner with Docker
|
| `make test-integration-heavy` | systest-heavy + ldbc + load |
| `make test-all` | Every test: all suites + integration2 + upgrade +
fuzz |
## Test plan
- [x] `make test-unit` runs without starting Docker cluster and
discovers only non-integration tests
- [x] `make test` (integration suite) correctly excludes heavy/ldbc/load
packages
- [x] `make test-integration-heavy` (`systest-heavy`) correctly runs
only heavy packages (11 packages)
- [x] `make test SUITE=systest` runs both systest-baseline and
systest-heavy (30 packages)
- [x] `make test SUITE=systest-baseline` runs only lightweight systests
(18 packages)
- [x] `TestImportApis/SingleGroupShutOneAlpha` passes reliably with
retry logic (CI)
- [x] Existing CI workflows continue to pass
---------
Co-authored-by: Shiva Kharsi (@shivaji-kharse / @shiva-istari) <[email protected]>1 parent 1a7fff6 commit 793fe9c
12 files changed
Lines changed: 576 additions & 121 deletions
File tree
- dgraphtest
- dgraph
- cmd/dgraphimport
- testutil
- t
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
144 | 145 | | |
145 | 146 | | |
146 | 147 | | |
147 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
148 | 152 | | |
149 | 153 | | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
150 | 157 | | |
151 | | - | |
152 | | - | |
153 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
154 | 163 | | |
155 | 164 | | |
156 | 165 | | |
| 166 | + | |
157 | 167 | | |
158 | 168 | | |
159 | 169 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
| 25 | + | |
24 | 26 | | |
25 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
26 | 35 | | |
27 | 36 | | |
28 | 37 | | |
| |||
60 | 69 | | |
61 | 70 | | |
62 | 71 | | |
63 | | - | |
| 72 | + | |
64 | 73 | | |
65 | 74 | | |
66 | 75 | | |
| |||
73 | 82 | | |
74 | 83 | | |
75 | 84 | | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
80 | 94 | | |
81 | 95 | | |
82 | | - | |
| 96 | + | |
83 | 97 | | |
84 | 98 | | |
85 | 99 | | |
| |||
97 | 111 | | |
98 | 112 | | |
99 | 113 | | |
100 | | - | |
101 | | - | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
102 | 125 | | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | 126 | | |
108 | 127 | | |
109 | | - | |
| 128 | + | |
| 129 | + | |
110 | 130 | | |
111 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
112 | 137 | | |
113 | 138 | | |
| 139 | + | |
114 | 140 | | |
115 | 141 | | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | 142 | | |
121 | 143 | | |
| 144 | + | |
122 | 145 | | |
123 | 146 | | |
124 | 147 | | |
125 | 148 | | |
| 149 | + | |
126 | 150 | | |
127 | 151 | | |
128 | 152 | | |
129 | | - | |
| 153 | + | |
| 154 | + | |
130 | 155 | | |
131 | 156 | | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
132 | 162 | | |
133 | 163 | | |
| 164 | + | |
134 | 165 | | |
135 | 166 | | |
136 | 167 | | |
137 | | - | |
| 168 | + | |
| 169 | + | |
138 | 170 | | |
139 | 171 | | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
147 | 178 | | |
148 | 179 | | |
149 | 180 | | |
| |||
152 | 183 | | |
153 | 184 | | |
154 | 185 | | |
155 | | - | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
156 | 191 | | |
157 | 192 | | |
158 | 193 | | |
| |||
161 | 196 | | |
162 | 197 | | |
163 | 198 | | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
164 | 206 | | |
165 | 207 | | |
166 | 208 | | |
| |||
201 | 243 | | |
202 | 244 | | |
203 | 245 | | |
204 | | - | |
| 246 | + | |
205 | 247 | | |
206 | 248 | | |
207 | 249 | | |
| |||
216 | 258 | | |
217 | 259 | | |
218 | 260 | | |
219 | | - | |
| 261 | + | |
220 | 262 | | |
| 263 | + | |
221 | 264 | | |
222 | 265 | | |
223 | 266 | | |
| |||
0 commit comments