Skip to content

Comments

fix(test): resolve macOS binary selection and test data clobbering#9605

Closed
mlwelles wants to merge 2 commits intodgraph-io:mainfrom
mlwelles:fix/shiva-test-mac-os
Closed

fix(test): resolve macOS binary selection and test data clobbering#9605
mlwelles wants to merge 2 commits intodgraph-io:mainfrom
mlwelles:fix/shiva-test-mac-os

Conversation

@mlwelles
Copy link
Contributor

Description

This PR builds upon #9603 by @shiva-istari and adds a fix for a pre-existing bug in t/t.go that is exposed when the 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.

Additional fix: test data clobbering in --suite=all

When running make test (--suite=all), the load and ldbc download blocks in t/t.go shared the same *tmp directory. The sequence was:

  1. Load block: sets *tmp = os.TempDir(), calls MakeDirEmpty, downloads 1million/21million data files
  2. LDBC block: *tmp is already set, calls MakeDirEmpty on the same directory — wiping the load data files
  3. systest/1million fails with Schema path(...1million-noindex.schema) does not exist

This bug existed on main but was masked because the macOS skip guards (removed by #9603) prevented systest/1million from ever running on macOS. On Linux CI, suites are typically run individually rather than via --suite=all, so the two download blocks never both executed.

Fix: 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 (load: 1million*, 21million*; LDBC: ldbcTypes.schema, *_0.rdf). Also uses a dedicated subdirectory (dgraph-test-data) instead of bare os.TempDir() to avoid wiping the system-wide temp directory.

Adds a testSuiteContainsAny() helper to replace repeated testSuiteContains("x") || testSuiteContains("y") patterns.

Checklist

  • The PR title follows the Conventional Commits syntax
  • Code compiles correctly and linting passes locally

Shiva and others added 2 commits February 19, 2026 18:19
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.
@mlwelles mlwelles requested a review from a team as a code owner February 19, 2026 22:15
@mlwelles mlwelles closed this Feb 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant