Skip to content

Conversation

@mlwelles
Copy link
Contributor

@mlwelles mlwelles commented Feb 4, 2026

Summary

  • Fixed flaky TestDropNamespaceErr in edgraph/namespace_test.go
  • DropAll and DropNamespace are asynchronous operations, but the test was asserting namespace count immediately after calling them
  • Added a local waitForNamespaceCount polling helper that retries ListNamespaces until the expected count is reached or a timeout occurs

Root Cause

The test intermittently failed with:

"map[0: 11:id:11]" should have 1 item(s), but has 2

This happened because DropNamespace returns before the schema state has fully propagated. The immediate ListNamespaces call would sometimes see stale data.

Test plan

  • CI dgraph-core-tests passes (previously flaky test should now be stable)
  • Verify no regressions in other namespace-related tests

DropAll and DropNamespace are asynchronous operations. The test was
flaky because it called ListNamespaces immediately after these
operations, before the state had propagated. Added polling helper
to wait for the expected namespace count.
@mlwelles mlwelles requested a review from a team as a code owner February 4, 2026 01:51
@github-actions github-actions bot added area/testing Testing related issues go Pull requests that update Go code labels Feb 4, 2026
@blacksmith-sh

This comment has been minimized.

@mlwelles mlwelles changed the title fix: make TestDropNamespaceErr resilient to async namespace operations fix(test): make TestDropNamespaceErr resilient to async namespace operations Feb 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/testing Testing related issues go Pull requests that update Go code

Development

Successfully merging this pull request may close these issues.

2 participants