# Error when running make test

**URL:** <https://forum.mattermost.com/t/error-when-running-make-test/3692>\
**Category:** Troubleshooting\
**Created:** [August 15, 2017, 3:52pm UTC](https://forum.mattermost.com/t/error-when-running-make-test/3692 "2017-08-15T15:52:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![santos22](https://avatars.discourse-cdn.com/v4/letter/s/a8b319/32.png) [@santos22](https://forum.mattermost.com/u/santos22)\
**Post date:** [August 15, 2017, 3:52pm UTC](https://forum.mattermost.com/t/error-when-running-make-test/3692/1 "2017-08-15T15:52:37Z")

</div>

#### Summary

`make test` fails and exit after the **TestZZWebSocketTearDown** test passes

#### Steps to reproduce

Clone the Mattermost repo (latest commit on mine was - [https://github.com/mattermost/platform/commit/bbf6c81a065d7d2c550b6a629cf31cc113b3713e](https://github.com/mattermost/platform/commit/bbf6c81a065d7d2c550b6a629cf31cc113b3713e))

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 ([https://github.com/mattermost/platform/issues/7113](https://github.com/mattermost/platform/issues/7113)) 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:

 ![50 AM](https://us1.discourse-cdn.com/flex020/uploads/mattermost/original/2X/3/3ac045406e321129d615fe0bfc331abf29edfae5.png)

**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] websocket.read: 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)  
FAIL  
coverage: 46.6% of statements in [github.com/mattermost/platform/api](http://github.com/mattermost/platform/api), [github.com/mattermost/platform/api4](http://github.com/mattermost/platform/api4), [github.com/mattermost/platform/app](http://github.com/mattermost/platform/app), [github.com/mattermost/platform/app/plugin](http://github.com/mattermost/platform/app/plugin), [github.com/mattermost/platform/app/plugin/jira](http://github.com/mattermost/platform/app/plugin/jira), [github.com/mattermost/platform/cmd/platform](http://github.com/mattermost/platform/cmd/platform), [github.com/mattermost/platform/einterfaces](http://github.com/mattermost/platform/einterfaces), [github.com/mattermost/platform/einterfaces/jobs](http://github.com/mattermost/platform/einterfaces/jobs), [github.com/mattermost/platform/imports](http://github.com/mattermost/platform/imports), [github.com/mattermost/platform/jobs](http://github.com/mattermost/platform/jobs), [github.com/mattermost/platform/manualtesting](http://github.com/mattermost/platform/manualtesting), [github.com/mattermost/platform/model](http://github.com/mattermost/platform/model), [github.com/mattermost/platform/model/gitlab](http://github.com/mattermost/platform/model/gitlab), [github.com/mattermost/platform/store](http://github.com/mattermost/platform/store), [github.com/mattermost/platform/utils](http://github.com/mattermost/platform/utils), [github.com/mattermost/platform/web](http://github.com/mattermost/platform/web), [github.com/mattermost/platform/wsapi](http://github.com/mattermost/platform/wsapi)  
exit status 1  
FAIL [github.com/mattermost/platform/api4](http://github.com/mattermost/platform/api4) 335.546s

---

<div class="post-metadata">

**Author:** ![prixone](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/prixone/32/1184_2.png) [@prixone](https://forum.mattermost.com/u/prixone)\
**Post date:** [August 15, 2017, 6:03pm UTC](https://forum.mattermost.com/t/error-when-running-make-test/3692/2 "2017-08-15T18:03:15Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![santos22](https://avatars.discourse-cdn.com/v4/letter/s/a8b319/32.png) [@santos22](https://forum.mattermost.com/u/santos22)\
**Post date:** [August 15, 2017, 7:04pm UTC](https://forum.mattermost.com/t/error-when-running-make-test/3692/3 "2017-08-15T19:04:08Z")

</div>

It is `make clean` 🙂

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

---

<div class="post-metadata">

**Author:** ![prixone](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/prixone/32/1184_2.png) [@prixone](https://forum.mattermost.com/u/prixone)\
**Post date:** [August 15, 2017, 9:14pm UTC](https://forum.mattermost.com/t/error-when-running-make-test/3692/4 "2017-08-15T21:14:29Z")

</div>

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](https://docs.mattermost.com/developer/dev-setup.html)), `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](https://docs.mattermost.com/developer/developer-flow.html#running-only-specific-unit-tests)

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 [mattermost/platform | Coveralls - Test Coverage History & Statistics](https://coveralls.io/github/mattermost/platform) will be accurate though
