fix(test): resolve macOS binary selection and test data clobbering#9606
Merged
matthewmcneely merged 6 commits intomainfrom Feb 23, 2026
Merged
fix(test): resolve macOS binary selection and test data clobbering#9606matthewmcneely merged 6 commits intomainfrom
matthewmcneely merged 6 commits intomainfrom
Conversation
When running `make test` (--suite=all), the load and ldbc download
blocks in t/t.go shared the same *tmp directory. The ldbc block's
MakeDirEmpty call wiped files downloaded by the load block, causing
systest/1million to fail with missing schema files.
Hoist directory initialization above both download blocks so
MakeDirEmpty runs exactly once. Both datasets coexist in the same
directory since their filenames don't overlap. Also use a dedicated
subdirectory (dgraph-test-data) instead of bare os.TempDir() to
avoid wiping the system temp directory.
Add testSuiteContainsAny() helper to replace repeated
testSuiteContains("x") || testSuiteContains("y") patterns.
30 Docker Compose files hardcoded $GOPATH/bin as the binary mount
source. On macOS, this mounts the native macOS binary into Linux
containers, causing them to fail on startup.
Replace all 78 occurrences with ${LINUX_GOBIN:-$GOPATH/bin} to match
the pattern already used in dgraph/docker-compose.yml. On Linux,
LINUX_GOBIN defaults to $GOPATH/bin (no change). On macOS, it points
to the cross-compiled Linux binary directory.
Add a configurable per-package test timeout flag to the t/ runner. Previously the timeout was hardcoded to 30m (or 180m with --race), which caused the 21million/live test to time out on slower machines. Usage: make test TIMEOUT=90m cd t && ./t --suite=all --timeout=60m Defaults remain unchanged: 30m normal, 180m with --race. An explicit --timeout overrides both.
This comment has been minimized.
This comment has been minimized.
Remove empty if-branch flagged by staticcheck SA9003 in t/t.go and fix markdown table alignment in TESTING.md for prettier compliance.
matthewmcneely
approved these changes
Feb 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR builds upon #9603 by @shiva-istari and adds fixes for issues exposed when macOS skip guards are removed.
Original PR (#9603)
Fix 1: test data clobbering in
--suite=all(t/t.go)When running
make test(--suite=all), theloadandldbcdownload blocks shared*tmp. The LDBC block'sMakeDirEmptywiped load data files, causingsystest/1millionto fail. Fixed by hoisting directory init above both download blocks soMakeDirEmptyruns once. Also uses a dedicated subdirectory (dgraph-test-data) instead of bareos.TempDir().Fix 2:
$GOPATH/binin Docker Compose files (30 files)30 Docker Compose files hardcoded
$GOPATH/binas 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 indgraph/docker-compose.yml.Fix 3: add
--timeoutflag to t/ runnerThe per-package test timeout was hardcoded to 30m, which is too short for the
21million/livetest on macOS (where Docker runs in a VM with I/O overhead). Added a--timeoutflag tot/t.goand wired it through the Makefile asTIMEOUT:Defaults remain unchanged: 30m normal, 180m with
--race. An explicit--timeoutoverrides both. Updated docs in Makefile help, CONTRIBUTING.md, and TESTING.md.Checklist