Skip to content

chore(test): Improve localcluster tests speed and resiliency#9499

Merged
matthewmcneely merged 15 commits intomainfrom
matthewmcneely/improve-localcluster-tests-speed-and-resiliency
Sep 24, 2025
Merged

chore(test): Improve localcluster tests speed and resiliency#9499
matthewmcneely merged 15 commits intomainfrom
matthewmcneely/improve-localcluster-tests-speed-and-resiliency

Conversation

@matthewmcneely
Copy link
Copy Markdown
Contributor

Description

This PR improves the speed and resiliency on tests that rely on the LocalCluster system

  • adds additional health and login checks to prevent timing issues with cluster creation
  • parallel-izes some creation, login and health check functions to minimize delays
  • adds support for using local dgraph image correctly when the DGRAPH_BINARY envar is present (tests on non-Linux systems that rely on running the native dgraph image would fail prior to this)
  • suppresses expected "error" log output before defined thresholds (helps minimize false positives when checking logs)

Checklist

  • Code compiles correctly and linting passes locally

@matthewmcneely matthewmcneely requested a review from a team August 27, 2025 18:31
@github-actions github-actions Bot added area/testing Testing related issues go Pull requests that update Go code labels Aug 27, 2025
@trunk-io
Copy link
Copy Markdown

trunk-io Bot commented Aug 27, 2025

Static BadgeStatic BadgeStatic BadgeStatic Badge

Failed Test Failure Summary Logs
TestBackupOfOldRestore The test failed because it could not establish a connection to retrieve predicate information. Logs ↗︎
Flaky Test Failure Summary Logs
TestImportApis/SingleGroupShutOneAlpha The test failed due to an error communicating with the Dgraph zero server, indicating that assigning IDs was attempted on a non-leader node. Logs ↗︎
TestImportApis The test 'TestImportApis' failed after running for a long duration. Logs ↗︎

View Full Report ↗︎Docs

Copilot AI review requested due to automatic review settings August 28, 2025 20:54
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves the speed and resiliency of LocalCluster tests by parallelizing operations, enhancing health checks, and addressing timing issues.

  • Parallelizes container creation, destruction, and health checks to reduce test execution time
  • Increases timeout thresholds and improves error suppression to reduce false positives
  • Adds support for native dgraph binaries via DGRAPH_BINARY environment variable

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
testutil/docker.go Increases health check thresholds and adds attempt counters for better logging
dgraphtest/local_cluster.go Parallelizes container operations and health checks using goroutines and wait groups
dgraphtest/load.go Adds support for custom dgraph binary names via DGRAPH_BINARY environment variable
dgraphtest/image.go Adds GOPATH validation and improves logging for binary setup
dgraph/cmd/dgraphimport/import_test.go Adds comprehensive retry logic and helper functions for cluster stability

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread testutil/docker.go
}

// checkHealthContainer checks health of container and determines wheather container is ready to accept request
// CheckHealthContainer checks health of container and determines wheather container is ready to accept request
Copy link

Copilot AI Aug 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a spelling error in the comment. 'wheather' should be 'whether'.

Suggested change
// CheckHealthContainer checks health of container and determines wheather container is ready to accept request
// CheckHealthContainer checks health of container and determines whether container is ready to accept request

Copilot uses AI. Check for mistakes.
Comment thread dgraphtest/local_cluster.go
@matthewmcneely matthewmcneely force-pushed the matthewmcneely/improve-localcluster-tests-speed-and-resiliency branch 2 times, most recently from 95890df to d108f7f Compare August 29, 2025 16:26
@shivaji-kharse shivaji-kharse force-pushed the matthewmcneely/improve-localcluster-tests-speed-and-resiliency branch from d108f7f to 6adcd4d Compare September 24, 2025 07:16
@github-actions github-actions Bot added the area/integrations Related to integrations with other projects. label Sep 24, 2025
@matthewmcneely matthewmcneely merged commit 36a9b70 into main Sep 24, 2025
14 of 15 checks passed
@matthewmcneely matthewmcneely deleted the matthewmcneely/improve-localcluster-tests-speed-and-resiliency branch September 24, 2025 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/integrations Related to integrations with other projects. area/testing Testing related issues go Pull requests that update Go code

Development

Successfully merging this pull request may close these issues.

3 participants