There is no way to shutdown copas server properly. Copas loop is never finished, since copas:finished() is never true, because websocket server that was added by copas:addserver(listener,...) is never removed from copas.
Solution:
In server_copas.lua, line 131 you call listener:close()
Instead, call copas:removeserver(listener). This removes the server from copas pool of tasks, and closes the socket (i.e., listener:close() is implied).
After this fix, server:close() method works fine and the script ends properly & almost immediately.
Coverage decreased (-0.29%) to 90.41% when pulling e8e7a1826e51ec8f0f34c25d41c679b7f193823e on nolar:master into 6dcf93c4e1e30566bb53b19437106e60f6a46979 on lipp:master.
Coverage remained the same at 90.7% when pulling e8e7a1826e51ec8f0f34c25d41c679b7f193823e on nolar:master into 6dcf93c4e1e30566bb53b19437106e60f6a46979 on lipp:master.
The problem:
There is no way to shutdown copas server properly. Copas loop is never finished, since copas:finished() is never true, because websocket server that was added by copas:addserver(listener,...) is never removed from copas.
Solution:
In server_copas.lua, line 131 you call listener:close()
Instead, call copas:removeserver(listener). This removes the server from copas pool of tasks, and closes the socket (i.e., listener:close() is implied).
After this fix, server:close() method works fine and the script ends properly & almost immediately.