mirror of
https://github.com/haveno-dex/haveno-ts.git
synced 2025-02-10 11:38:27 -05:00
fixes to start/stop local node test
This commit is contained in:
parent
40128e38a3
commit
a00052d019
@ -898,7 +898,7 @@ test("Can manage Monero daemon connections (CI)", async () => {
|
|||||||
// - user1-daemon-local must be running and own its monerod process (so it can be stopped)
|
// - user1-daemon-local must be running and own its monerod process (so it can be stopped)
|
||||||
test("Can start and stop a local Monero node (CI)", async() => {
|
test("Can start and stop a local Monero node (CI)", async() => {
|
||||||
|
|
||||||
// expect error stopping local node
|
// expect error stopping stopped local node
|
||||||
try {
|
try {
|
||||||
await user1.stopMoneroNode();
|
await user1.stopMoneroNode();
|
||||||
HavenoUtils.log(1, "Running local Monero node stopped");
|
HavenoUtils.log(1, "Running local Monero node stopped");
|
||||||
@ -911,8 +911,7 @@ test("Can start and stop a local Monero node (CI)", async() => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let isMoneroNodeOnline = await user1.isMoneroNodeOnline();
|
if (await user1.isMoneroNodeOnline()) {
|
||||||
if (isMoneroNodeOnline) {
|
|
||||||
HavenoUtils.log(0, "Warning: local Monero node is already running, skipping start and stop local Monero node tests");
|
HavenoUtils.log(0, "Warning: local Monero node is already running, skipping start and stop local Monero node tests");
|
||||||
|
|
||||||
// expect error due to existing running node
|
// expect error due to existing running node
|
||||||
@ -944,8 +943,7 @@ test("Can start and stop a local Monero node (CI)", async() => {
|
|||||||
settings.setBlockchainPath(dataDir);
|
settings.setBlockchainPath(dataDir);
|
||||||
settings.setStartupFlagsList(["--log-file", logFile, "--no-zmq"]);
|
settings.setStartupFlagsList(["--log-file", logFile, "--no-zmq"]);
|
||||||
await user1.startMoneroNode(settings);
|
await user1.startMoneroNode(settings);
|
||||||
isMoneroNodeOnline = await user1.isMoneroNodeOnline();
|
assert(await user1.isMoneroNodeOnline());
|
||||||
assert(isMoneroNodeOnline);
|
|
||||||
|
|
||||||
// expect settings are updated
|
// expect settings are updated
|
||||||
const settingsAfter = await user1.getMoneroNodeSettings();
|
const settingsAfter = await user1.getMoneroNodeSettings();
|
||||||
@ -967,16 +965,19 @@ test("Can start and stop a local Monero node (CI)", async() => {
|
|||||||
|
|
||||||
// expect stopped node
|
// expect stopped node
|
||||||
await user1.stopMoneroNode();
|
await user1.stopMoneroNode();
|
||||||
isMoneroNodeOnline = await user1.isMoneroNodeOnline();
|
assert(!(await user1.isMoneroNodeOnline()));
|
||||||
assert(!isMoneroNodeOnline);
|
|
||||||
try {
|
try {
|
||||||
daemon = await moneroTs.connectToDaemonRpc(TestConfig.monerod.url);
|
daemon = await moneroTs.connectToDaemonRpc(TestConfig.monerod.url);
|
||||||
height = await daemon.getHeight();
|
height = await daemon.getHeight();
|
||||||
console.log("GOT HEIGHT: " + height);
|
console.log("GOT HEIGHT: " + height);
|
||||||
throw new Error("should have thrown");
|
throw new Error("should have thrown");
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
if (err.message !== "RequestError: Error: connect ECONNREFUSED 127.0.0.1:28081") throw new Error("Unexpected error: " + err.message);
|
if (err.message.indexOf("connect ECONNREFUSED 127.0.0.1:28081") <= 0) throw new Error("Unexpected error: " + err.message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// start local node again
|
||||||
|
await user1.startMoneroNode(settings);
|
||||||
|
assert(await user1.isMoneroNodeOnline());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user