mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-13 23:14:53 +09:00
Merge pull request #364 from Hornwitser/fix-windows-2
Fix windows test failure
This commit is contained in:
6 files changed
+18
-3
No files matched your search
+2
-1
@@ -2,7 +2,7 @@
|
||||
"name": "root",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"test": "mocha --exit --check-leaks -R spec --recursive test plugins/global_chat/test plugins/research_sync/test plugins/statistics_exporter/test plugins/subspace_storage/test",
|
||||
"test": "mocha --check-leaks -R spec --recursive test plugins/global_chat/test plugins/research_sync/test plugins/statistics_exporter/test plugins/subspace_storage/test",
|
||||
"fast-test": "FAST_TEST=y npm test",
|
||||
"cover": "nyc npm test",
|
||||
"fast-cover": "FAST_TEST=y nyc npm test",
|
||||
@@ -32,6 +32,7 @@
|
||||
"jszip": "^3.2.2",
|
||||
"lerna": "^3.22.1",
|
||||
"mocha": "^6.2.0",
|
||||
"node-forge": "^0.10.0",
|
||||
"nyc": "^14.1.1",
|
||||
"phin": "^3.4.1",
|
||||
"webpack": "^5.0.0"
|
||||
|
||||
@@ -211,6 +211,13 @@ class WebSocketClientConnector extends WebSocketBaseConnector {
|
||||
if (this._reconnectId) {
|
||||
clearTimeout(this._reconnectId);
|
||||
this._reconnectId = null;
|
||||
this._lastReceivedSeq = null;
|
||||
this._sessionToken = null;
|
||||
this._sendBuffer.length = 0;
|
||||
this._state = "new";
|
||||
this._connected = false;
|
||||
this.emit("close");
|
||||
return;
|
||||
}
|
||||
|
||||
this.stopHeartbeat();
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
"jsonwebtoken": "^8.2.1",
|
||||
"jszip": "^3.2.2",
|
||||
"klaw": "^3.0.0",
|
||||
"node-forge": "^0.10.0",
|
||||
"rcon-client": "^4.2.0",
|
||||
"semver": "^7.1.1",
|
||||
"set-blocking": "^2.0.0",
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
"jsonwebtoken": "^8.2.1",
|
||||
"jszip": "^3.2.2",
|
||||
"node-factorio-api": "^0.3.8",
|
||||
"node-forge": "^0.10.0",
|
||||
"set-blocking": "^2.0.0",
|
||||
"winston": "^3.3.3",
|
||||
"ws": "^7.2.3",
|
||||
|
||||
@@ -175,6 +175,7 @@ after(async function() {
|
||||
masterProcess.kill("SIGINT");
|
||||
await events.once(masterProcess, "exit");
|
||||
}
|
||||
await control.connector.close();
|
||||
});
|
||||
|
||||
// Ensure the test processes are stopped.
|
||||
|
||||
@@ -53,4 +53,12 @@ describe("Integration of lib/link", function() {
|
||||
await events.once(controlConnector, "invalidate");
|
||||
await events.once(controlConnector, "connect");
|
||||
});
|
||||
|
||||
it("should properly close connector if close is called during reconnect wait", async function() {
|
||||
controlConnector._socket.close(1008, "Test");
|
||||
controlConnector.once("drop", () => {
|
||||
controlConnector.close();
|
||||
});
|
||||
await events.once(controlConnector, "close");
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user