-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Server stopping requires too much time #2
Comments
Sorry for late answer. Fixed it in version 1.00, but please beware that server needs much time (about 4 seconds) to stop (that seems like express's issue). You can check updated example for this. |
@sylvainmetayer I investigated large timeout matter a bit further - it is not even express's problem, that's a nodejs problem - it does not stop http server if there are keep alive connections (and telegram bot uses keep alive connections): nodejs/node-v0.x-archive#9066 Pretty funny to see that bug from 0.x versions is still present in node 9.... I will try to find some workaround. |
@jehy Thanks for the explanation ! I'll give it a try tomorrow or wednesday and I'll come back to you |
Fixed it in version 1.0.1 : ) |
I've updated to 1.0.1 but it seems that I'm still having the issue. Here is how I tried to stop the server but I keep having an "EFATAL : Error: connect ECONNREFUSED 127.0.0.1:9000" polling error. Is it related to your last changes ? |
Telegram bot client continues polling and that causes errors. You should add after(function (done) {
telegramBot.stopPolling();
// Because server.close() doesn't work and freeze CI
if (process.env.CIRCLECI != undefined) {
process.exit();
}
server.stop();
done();
}) By the way, after(function (done) {
telegramBot.stopPolling();
// Because server.close() doesn't work and freeze CI
if (process.env.CIRCLECI != undefined) {
process.exit();
}
return server.stop();
}) |
Great, it is now fixed ! Thanks ! |
Hello,
I'm developping a Telegram Bot for a school project and need a way to test it.
But I've got an issue when running tests, the server doesn't seems to stop. All tests are correctly executed, but the close promise isn't resolved.
The last output I can have is the "Stopping server..." but I never enter here (https://github.com/jehy/telegram-test-api/blob/master/src/telegramServer.js#L159).
Is this a known bug or am I using your package the wrong way ?
You can find below a example of my test file.
Thank you in advance for your reply !
The text was updated successfully, but these errors were encountered: