Merge pull request #364 from Hornwitser/fix-windows-2

Fix windows test failure
This commit is contained in:
Hornwitser authored and GitHub committed 2021-03-07 13:34:57 +01:00
commit 53edd7cce6
6 files changed
+18 -3

No files matched your search

+2 -1
View File
@@ -2,7 +2,7 @@
"name": "root", "name": "root",
"private": true, "private": true,
"scripts": { "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", "fast-test": "FAST_TEST=y npm test",
"cover": "nyc npm test", "cover": "nyc npm test",
"fast-cover": "FAST_TEST=y nyc npm test", "fast-cover": "FAST_TEST=y nyc npm test",
@@ -32,6 +32,7 @@
"jszip": "^3.2.2", "jszip": "^3.2.2",
"lerna": "^3.22.1", "lerna": "^3.22.1",
"mocha": "^6.2.0", "mocha": "^6.2.0",
"node-forge": "^0.10.0",
"nyc": "^14.1.1", "nyc": "^14.1.1",
"phin": "^3.4.1", "phin": "^3.4.1",
"webpack": "^5.0.0" "webpack": "^5.0.0"
+7
View File
@@ -211,6 +211,13 @@ class WebSocketClientConnector extends WebSocketBaseConnector {
if (this._reconnectId) { if (this._reconnectId) {
clearTimeout(this._reconnectId); clearTimeout(this._reconnectId);
this._reconnectId = null; 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(); this.stopHeartbeat();
-1
View File
@@ -19,7 +19,6 @@
"jsonwebtoken": "^8.2.1", "jsonwebtoken": "^8.2.1",
"jszip": "^3.2.2", "jszip": "^3.2.2",
"klaw": "^3.0.0", "klaw": "^3.0.0",
"node-forge": "^0.10.0",
"rcon-client": "^4.2.0", "rcon-client": "^4.2.0",
"semver": "^7.1.1", "semver": "^7.1.1",
"set-blocking": "^2.0.0", "set-blocking": "^2.0.0",
-1
View File
@@ -29,7 +29,6 @@
"jsonwebtoken": "^8.2.1", "jsonwebtoken": "^8.2.1",
"jszip": "^3.2.2", "jszip": "^3.2.2",
"node-factorio-api": "^0.3.8", "node-factorio-api": "^0.3.8",
"node-forge": "^0.10.0",
"set-blocking": "^2.0.0", "set-blocking": "^2.0.0",
"winston": "^3.3.3", "winston": "^3.3.3",
"ws": "^7.2.3", "ws": "^7.2.3",
+1
View File
@@ -175,6 +175,7 @@ after(async function() {
masterProcess.kill("SIGINT"); masterProcess.kill("SIGINT");
await events.once(masterProcess, "exit"); await events.once(masterProcess, "exit");
} }
await control.connector.close();
}); });
// Ensure the test processes are stopped. // Ensure the test processes are stopped.
+8
View File
@@ -53,4 +53,12 @@ describe("Integration of lib/link", function() {
await events.once(controlConnector, "invalidate"); await events.once(controlConnector, "invalidate");
await events.once(controlConnector, "connect"); 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");
});
}); });