public class GraknTestUtil extends Object
Houses common testing methods which are needed between different modules
| Constructor and Description |
|---|
GraknTestUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
allocateSparkPort(ai.grakn.engine.GraknConfig config)
Allocates an unused port for Spark.
|
static boolean |
usingJanus() |
static boolean |
usingTinker() |
public static boolean usingTinker()
public static boolean usingJanus()
public static void allocateSparkPort(ai.grakn.engine.GraknConfig config)
This should always be called immediately before Spark starts in order to minimise a potential race condition: in between finding an unused port and starting Spark, something else may steal the same port.
The correct way to solve this race condition is to specify the Spark port as 0. Then, Spark will allocate
the port itself. However, there is an issue where Service.port() will always report 0 even after
Spark has started.
Copyright © 2018 Grakn Labs Ltd. All rights reserved.