From c5c2cfaf2e97fd6521c176d039e1392244763a97 Mon Sep 17 00:00:00 2001 From: Sam Havens Date: Wed, 11 Dec 2019 11:29:59 -0800 Subject: [PATCH] more comments to explain wtf is going on with echo test --- tests/echo-server.js | 12 ++++++++++++ tests/test_mc.py | 9 +++++++++ 2 files changed, 21 insertions(+) diff --git a/tests/echo-server.js b/tests/echo-server.js index c855aeb..4f74c03 100644 --- a/tests/echo-server.js +++ b/tests/echo-server.js @@ -1,7 +1,19 @@ +/* + * This NodeJS file starts a websocket echo server + * You don't need to manually invoke this + * Just run the tests by running client.marian/test.sh + * It will start this server and run pytests + * + * If this doesn't work, and you are debugging, first make sure you have + * nodejs version 10 or higher installed on your machine + */ + const WebSocket = require('ws'); const wss = new WebSocket.Server({ port: 8080 }); +console.log("Echo websocket running at port 8080") + function sleep(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } diff --git a/tests/test_mc.py b/tests/test_mc.py index 25cdbf0..112c3a2 100644 --- a/tests/test_mc.py +++ b/tests/test_mc.py @@ -1,3 +1,12 @@ +""" +This test shouldn't be run directly with pytest +(unless you really get what's going on) + +It is meant to be run by invoking client.marian/test.sh +that shell script spins up a websocket echo server with artificial latency +which this script talks to +""" + import pytest from essential_generators import DocumentGenerator