Commit ffab4bb
fix(test): resolve macOS binary selection and test data clobbering (#9606)
**Description**
This PR builds upon
[#9603](#9603) by @shiva-istari
and adds fixes for issues exposed when macOS skip guards are removed.
### Original PR (#9603)
> On macOS, setupBinary() now copies both the Linux binary (for Docker
containers) and the host-native binary (for local bulk/live loader
commands) into tempBinDir. On Linux, a single binary serves both
purposes. BulkLoad() and LiveLoad() use hostDgraphBinaryPath() to pick
the correct one based on the platform. Removed macOS skip guards from 13
test files so all tests run on both platforms after make install.
### Fix 1: test data clobbering in `--suite=all` (`t/t.go`)
When running `make test` (`--suite=all`), the `load` and `ldbc` download
blocks shared `*tmp`. The LDBC block's `MakeDirEmpty` wiped load data
files, causing `systest/1million` to fail. Fixed by hoisting directory
init above both download blocks so `MakeDirEmpty` runs once. Also uses a
dedicated subdirectory (`dgraph-test-data`) instead of bare
`os.TempDir()`.
### Fix 2: `$GOPATH/bin` in Docker Compose files (30 files)
30 Docker Compose files hardcoded `$GOPATH/bin` as the binary mount
source. On macOS this mounts the native binary into Linux containers,
crashing them. Replaced all 78 occurrences with
`${LINUX_GOBIN:-$GOPATH/bin}` to match the pattern in
`dgraph/docker-compose.yml`.
### Fix 3: add `--timeout` flag to t/ runner
The per-package test timeout was hardcoded to 30m, which is too short
for the `21million/live` test on macOS (where Docker runs in a VM with
I/O overhead). Added a `--timeout` flag to `t/t.go` and wired it through
the Makefile as `TIMEOUT`:
```bash
make test TIMEOUT=90m
cd t && ./t --suite=all --timeout=60m
```
Defaults remain unchanged: 30m normal, 180m with `--race`. An explicit
`--timeout` overrides both. Updated docs in Makefile help,
CONTRIBUTING.md, and TESTING.md.
**Checklist**
- [x] The PR title follows the [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) syntax
- [x] Code compiles correctly and linting passes locally
---------
Co-authored-by: Shiva <[email protected]>1 parent 9ffab52 commit ffab4bb
50 files changed
Lines changed: 190 additions & 214 deletions
File tree
- check_upgrade
- dgraphtest
- dgraph/cmd
- alpha/mutations_mode
- dgraphimport
- live
- load-json
- load-uids
- version
- graphql
- e2e
- admin_auth
- poorman_auth_with_acl
- poorman_auth
- auth_closed_by_default
- auth
- debug_off
- custom_logic
- directives
- multi_tenancy
- normal
- schema
- subscription
- testdata/custom_bench/profiling
- ocagent
- systest
- 1million
- 21million/bulk
- audit_encrypted
- bulk_live/bulk
- cdc
- export
- integration2
- ldbc
- loader
- testutil
- testaudit
- tlstest
- acl
- certrequest
- certrequireandverify
- certverifyifgiven
- mtls_internal
- ha_6_node
- multi_group
- single_node
- zero_https
- all_routes_tls
- no_tls
- t
- worker
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
| 157 | + | |
157 | 158 | | |
158 | 159 | | |
159 | 160 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
| 208 | + | |
208 | 209 | | |
209 | 210 | | |
210 | 211 | | |
| |||
223 | 224 | | |
224 | 225 | | |
225 | 226 | | |
| 227 | + | |
226 | 228 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
335 | 335 | | |
336 | 336 | | |
337 | 337 | | |
| 338 | + | |
338 | 339 | | |
339 | 340 | | |
340 | 341 | | |
| |||
578 | 579 | | |
579 | 580 | | |
580 | 581 | | |
581 | | - | |
582 | | - | |
583 | | - | |
584 | | - | |
585 | | - | |
586 | | - | |
587 | | - | |
588 | | - | |
589 | | - | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
590 | 592 | | |
591 | 593 | | |
592 | 594 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | 13 | | |
15 | | - | |
16 | 14 | | |
17 | | - | |
18 | 15 | | |
19 | 16 | | |
20 | 17 | | |
| |||
28 | 25 | | |
29 | 26 | | |
30 | 27 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | 28 | | |
37 | 29 | | |
38 | 30 | | |
| |||
88 | 80 | | |
89 | 81 | | |
90 | 82 | | |
91 | | - | |
| 83 | + | |
92 | 84 | | |
93 | 85 | | |
94 | 86 | | |
| |||
108 | 100 | | |
109 | 101 | | |
110 | 102 | | |
111 | | - | |
| 103 | + | |
112 | 104 | | |
113 | 105 | | |
114 | 106 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
| 103 | + | |
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | 13 | | |
15 | | - | |
16 | 14 | | |
17 | 15 | | |
18 | 16 | | |
| |||
326 | 324 | | |
327 | 325 | | |
328 | 326 | | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | 327 | | |
335 | 328 | | |
336 | 329 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
| |||
162 | 161 | | |
163 | 162 | | |
164 | 163 | | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | 164 | | |
172 | 165 | | |
173 | 166 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
351 | 351 | | |
352 | 352 | | |
353 | 353 | | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | 354 | | |
361 | 355 | | |
362 | 356 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | 9 | | |
11 | 10 | | |
12 | | - | |
13 | 11 | | |
14 | 12 | | |
15 | 13 | | |
| |||
19 | 17 | | |
20 | 18 | | |
21 | 19 | | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | 20 | | |
28 | 21 | | |
29 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
31 | | - | |
32 | | - | |
33 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
34 | 44 | | |
35 | 45 | | |
36 | 46 | | |
| |||
43 | 53 | | |
44 | 54 | | |
45 | 55 | | |
46 | | - | |
| 56 | + | |
| 57 | + | |
47 | 58 | | |
48 | 59 | | |
49 | | - | |
50 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
51 | 84 | | |
52 | 85 | | |
53 | 86 | | |
| |||
0 commit comments