@@ -3,7 +3,7 @@ namespace SurrealDB.Shared.Tests;
33public static class SurrealInstance {
44 public static Process Create ( ) {
55 // Wait until port is closed
6- TcpHelper . SpinUntilClosed ( $ "0.0.0.0 :{ TestHelper . Port } ") ;
6+ TcpHelper . SpinUntilClosed ( $ "{ TestHelper . Loopback } :{ TestHelper . Port } ") ;
77 // We have a race condition between when the SurrealDB socket opens (or closes), and when it accepts connections.
88 // 50ms should be enough to run the tests on most devices.
99 // Thread.Sleep(50);
@@ -14,17 +14,20 @@ public static Process Create() {
1414 // Start new instances
1515 var p = Instantiate ( path ! ) ;
1616 Debug . Assert ( p is not null ) ;
17- TcpHelper . SpinUntilListening ( $ "0.0.0.0 :{ TestHelper . Port } ") ;
17+ TcpHelper . SpinUntilListening ( $ "{ TestHelper . Loopback } :{ TestHelper . Port } ") ;
1818 // Thread.Sleep(50);
1919 Debug . Assert ( ! p . HasExited ) ;
2020 return p ;
2121 }
2222
2323 private static Process ? Instantiate ( string path ) {
2424 ProcessStartInfo pi = new ( ) {
25+ // These two settings can make the tests run twice as fast, but makes it harder to kill rouge DB instances
26+ //CreateNoWindow = true,
27+ //UseShellExecute = false,
2528 UseShellExecute = true ,
2629 FileName = path ,
27- Arguments = $ "start memory -b 0.0.0.0 :{ TestHelper . Port } -u { TestHelper . User } -p { TestHelper . Pass } --log debug",
30+ Arguments = $ "start memory -b { TestHelper . Loopback } :{ TestHelper . Port } -u { TestHelper . User } -p { TestHelper . Pass } --log debug",
2831 WorkingDirectory = Environment . CurrentDirectory
2932 } ;
3033 return Process . Start ( pi ) ;
0 commit comments