# Testing beat module test\_modules.Test freezes

**URL:** <https://discuss.elastic.co/t/testing-beat-module-test-modules-test-freezes/216138>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [January 22, 2020, 9:18pm UTC](https://discuss.elastic.co/t/testing-beat-module-test-modules-test-freezes/216138 "2020-01-22T21:18:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jim\_Ivey](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jim_ivey/32/60991_2.png) [@Jim\_Ivey](https://discuss.elastic.co/u/Jim_Ivey)\
**Post date:** [January 22, 2020, 9:18pm UTC](https://discuss.elastic.co/t/testing-beat-module-test-modules-test-freezes/216138/1 "2020-01-22T21:18:46Z")

</div>

I'm trying to develop a module for `filebeat`. Running `make testsuite`, the furthest it ever gets is testing my module, where it just freezes -- for hours. For example:

```auto
test_fileset_file_071_postgresql (test_modules.Test) ... ok (2.8172s)
test_fileset_file_072_postgresql (test_modules.Test) ... ok (2.8613s)
test_fileset_file_073_postgresql (test_modules.Test) ... ok (2.5822s)
test_fileset_file_074_icinga (test_modules.Test) ... ok (2.7147s)
test_fileset_file_075_icinga (test_modules.Test) ... ok (2.5620s)
test_fileset_file_076_icinga (test_modules.Test) ... ok (2.6743s)
test_fileset_file_077_my_module (test_modules.Test) ... 

```

I'm guessing there's something fundamental that's wrong with my module, but I can only guess without more information. Where can I find more information about what's happening in my module?

I set up my dev environment as described [here](https://www.elastic.co/guide/en/beats/devguide/master/beats-contributing.html#setting-up-dev-environment) within the last couple weeks. So my version of everything ought to be up to date.

Any help is greatly appreciated.

---

<div class="post-metadata">

**Author:** ![Mario\_Castro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mario_castro/32/35107_2.png) [@Mario\_Castro](https://discuss.elastic.co/u/Mario_Castro)\
**Post date:** [January 23, 2020, 12:38pm UTC](https://discuss.elastic.co/t/testing-beat-module-test-modules-test-freezes/216138/2 "2020-01-23T12:38:24Z")

</div>

Hi @Jim_Ivey 🙂

The kind of freezing errors in Filebeat are usually syntax errors. For example, an incorrect Grok pattern (a simple comma can make it fail already). You can test the patterns here [https://grokconstructor.appspot.com/do/match](https://grokconstructor.appspot.com/do/match) for example (be aware because that webpage uses Ruby Grok which is slightly different to the one on Filebeat but still 95% compatible).

Another freezing issue can be in the input example log file like [this example](https://github.com/elastic/beats/blob/master/filebeat/module/haproxy/log/test/httplog-no-headers.log). They must end with a newline.

I encourage you to open a PR in the repo if you think it can be contributed, we are happy to assist people in developing their modules to the repo. It is easier to help too 😅

By the way, you don't need to run the entire testsuite every time you want to check your code. For example, you can run nginx with the following oneliner in filebeat folder:  
`TESTING_FILEBEAT_MODULES=nginx INTEGRATION_TESTS=1 nosetests -v -d -s tests/system/test_modules.py`

---

<div class="post-metadata">

**Author:** ![Jim\_Ivey](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jim_ivey/32/60991_2.png) [@Jim\_Ivey](https://discuss.elastic.co/u/Jim_Ivey)\
**Post date:** [January 23, 2020, 6:21pm UTC](https://discuss.elastic.co/t/testing-beat-module-test-modules-test-freezes/216138/3 "2020-01-23T18:21:00Z")

</div>

Thanks! It turns out I was using the `timestamp` processor described [here](https://www.elastic.co/guide/en/beats/filebeat/7.5/processor-timestamp.html), and whatever I'm using hadn't heard of it.

Your last tip really speeds thing up for me! Thanks!

FWIW, playing with `find` and `grep`, I found a lot of information in `build/system-tests/run/test_modules.Test.test_fileset_file_077_my_module/output.log` Though, after running the single-module test, that file is empty.

Duh, my bad: since I'm just testing a single module, it's no longer at `...file_077...`; it's now at `...file_0...`. Thanks again!

---

<div class="post-metadata">

**Author:** ![Jim\_Ivey](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jim_ivey/32/60991_2.png) [@Jim\_Ivey](https://discuss.elastic.co/u/Jim_Ivey)\
**Post date:** [January 23, 2020, 8:16pm UTC](https://discuss.elastic.co/t/testing-beat-module-test-modules-test-freezes/216138/4 "2020-01-23T20:16:24Z")

</div>

The single-module testing is failing due to a missing file: `ls: cannot access '.../go/src/github.com/elastic/beats/filebeat/filebeat.test': No such file or directory`

I've run `make`, `make update`, and `make fmt` and still no file. I've even run `make testsuite` just in case that generates the file -- no luck.

What am I missing? Any help is greatly appreciated.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 20, 2020, 8:16pm UTC](https://discuss.elastic.co/t/testing-beat-module-test-modules-test-freezes/216138/5 "2020-02-20T20:16:26Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
