Error when running make test


make test fails and exit after the TestZZWebSocketTearDown test passes

Steps to reproduce

Clone the Mattermost repo (latest commit on mine was -

Run make test and wait a couple of minutes to see the error message found in the screenshot below.

Expected behavior

I was working on an issue ( when I encountered this problem. However, I then cloned the most recent version of Mattermost without making any changes, ran make test and still got the same error message found below.

Observed behavior

After running make test, you see log messages on the terminal and at one point the tests stop running. The following screenshot is the observed behavior:

Actual screenshot text:
=== RUN TestWebSocket
[2017/08/15 08:42:42 PDT] [DEBG] GET - /api/v4/websocket
[2017/08/15 08:42:42 PDT] [DEBG] closing websocket for userId=yjahxnhpgtfw5bxcyrg17xitwh error=websocket: close 1006 (abnormal closure): unexpected EOF
[2017/08/15 08:42:42 PDT] [DEBG] GET - /api/v4/websocket
[2017/08/15 08:42:43 PDT] [DEBG] /api/v3/users/websocket:ping
[2017/08/15 08:42:43 PDT] [EROR] websocket routing error: seq=4 uid=yjahxnhpgtfw5bxcyrg17xitwh api.web_socket_router.no_action.app_error [details: ]
[2017/08/15 08:42:43 PDT] [EROR] websocket routing error: seq=5 uid=yjahxnhpgtfw5bxcyrg17xitwh api.web_socket_router.bad_action.app_error [details: ]
[2017/08/15 08:42:43 PDT] [EROR] websocket routing error: seq=0 uid=yjahxnhpgtfw5bxcyrg17xitwh api.web_socket_router.bad_seq.app_error [details: ]
[2017/08/15 08:42:44 PDT] [DEBG] /api/v3/users/websocket:user_typing
[2017/08/15 08:42:44 PDT] [EROR] /api/v3/users/websocket:user_typing seq=6 uid=yjahxnhpgtfw5bxcyrg17xitwh Invalid channel_id parameter [details: ]
— PASS: TestWebSocket (3.13s)
=== RUN TestZZWebSocketTearDown
[2017/08/15 08:42:46 PDT] [INFO] Stopping Server…
[2017/08/15 08:42:46 PDT] [INFO] Closing SqlStore
[2017/08/15 08:42:46 PDT] [INFO] stopping websocket hub connections
[2017/08/15 08:42:46 PDT] [INFO] Server stopped
— PASS: TestZZWebSocketTearDown (2.00s)
coverage: 46.6% of statements in,,,,,,,,,,,,,,,,
exit status 1
FAIL 335.546s

Does the issue remains if u do a make clean && make test? or was it make clear

It is make clean :slight_smile:

I tried running both commands like you suggested and the issue still remains.

Well you don’t necessarily need to do make test in order to compile mattermost, you can use make run directly, despite the fact you’re getting errors with the make test, assuming you have everything installed right(followed one of the guides for dev setup for the environment in question), make run or make package should compile without issues.

However if what you’re fixing depends on some test you need to add or modify, I suppose the fastest route to ensure your test is working would be this

The make test command is not like a regular make test you normally see when compiling application on linux, but more of a unit test of the features of mattermost it self.

Further talking to the team about the test coverage, @hmhealey said:

I don’t think it accounts for cross-package testing (like api4 code testing store code) by default. The numbers on will be accurate though