Skip to content
This repository was archived by the owner on Dec 18, 2023. It is now read-only.

Commit 5a6892e

Browse files
authored
Merge pull request #61 from Surreal-Net/tests_on_windows_fixes
2 parents 2a1ed22 + 9fd0a67 commit 5a6892e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tests/Shared/SurrealInstance.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ namespace SurrealDB.Shared.Tests;
33
public 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

Comments
 (0)