From ba5973aba4316b88e5167037b504cf8b8f986667 Mon Sep 17 00:00:00 2001 From: Enrico Minack Date: Mon, 16 Dec 2024 10:56:00 +0100 Subject: [PATCH] Assert max uid to detect uid range issues (#275) ## Checklist before submitting - [X] Did you read the [contributing guide](https://github.com/G-Research/spark-dgraph-connector/blob/contributing-guidelines/CONTRIBUTING.md)? - [ ] Did you update the docs? - [ ] Did you write any tests to validate this change? ## Description Asserts the max uid of the Dgraph instance used for unit tests to flag unexpected large uid ranges. ## Review process for approval 1. All tests and other checks must succeed. 2. At least one core contributors must review and approve. 3. If a core contributor requests changes, they must be addressed. --- .../uk/co/gresearch/spark/dgraph/DgraphTestCluster.scala | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/test/scala/uk/co/gresearch/spark/dgraph/DgraphTestCluster.scala b/src/test/scala/uk/co/gresearch/spark/dgraph/DgraphTestCluster.scala index 4fb145fb..ba4ae9f7 100644 --- a/src/test/scala/uk/co/gresearch/spark/dgraph/DgraphTestCluster.scala +++ b/src/test/scala/uk/co/gresearch/spark/dgraph/DgraphTestCluster.scala @@ -41,7 +41,10 @@ trait DgraphTestCluster extends BeforeAndAfterAll { lazy val dgraph = new DgraphCluster(alwaysStartUp = clusterAlwaysStartUp) - override protected def beforeAll(): Unit = dgraph.start() + override protected def beforeAll(): Unit = { + dgraph.start() + assert(dgraph.highestUid < 1024) + } override protected def afterAll(): Unit = dgraph.stop() }