Skip to content

Comments

fix(test): resolve dgraph binary selection for macOS in dgraphtest and testutil#9603

Closed
shiva-istari wants to merge 1 commit intomainfrom
shiva/test-mac-os
Closed

fix(test): resolve dgraph binary selection for macOS in dgraphtest and testutil#9603
shiva-istari wants to merge 1 commit intomainfrom
shiva/test-mac-os

Conversation

@shiva-istari
Copy link
Contributor

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.

@shiva-istari shiva-istari requested a review from a team as a code owner February 18, 2026 11:17
@github-actions github-actions bot added area/testing Testing related issues area/live-loader Issues related to live loading. go Pull requests that update Go code labels Feb 18, 2026
@blacksmith-sh

This comment has been minimized.

@mlwelles
Copy link
Contributor

mlwelles commented Feb 19, 2026

Thanks @shiva-istari! Incorporated your changes into #9606 with an additional fix for a data clobbering bug in t/t.go that surfaces when running --suite=all on macOS. Closing in favor of #9606.

@mlwelles mlwelles closed this Feb 19, 2026
matthewmcneely pushed a commit that referenced this pull request Feb 23, 2026
…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 <shiva@Shivajis-MacBook-Pro.local>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/live-loader Issues related to live loading. area/testing Testing related issues go Pull requests that update Go code

Development

Successfully merging this pull request may close these issues.

2 participants