django / django/channels

Test fail when run under something - ChannelsLiveServerTestCase

Open
#2,149 8 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
6.4k
Forks
826
PR merge metrics
No merged PRs in 30d

Description

Hi,
I know the issue title might sound a bit strange, but I’m not sure how to better describe what’s going on.

I'm currently working on test cases to improve [django-eventstream](https://github.com/fanout/django-eventstream).

Here are the related tests:
[tests/test_stream.py](https://github.com/enzofrnt/django-eventstream/blob/default-cross-process-send_event/tests/test_stream.py)

When I run them individually using:

```bash
pytest tests/test_stream.py
```

everything works fine. But when I run them with:

```bash
pytest
```

or through:

```bash
tox
```

they start failing. It seems like when the tests are executed along with others, or maybe under different process contexts, something changes — perhaps the test priority or isolation — and some of the parsing logic in the code fails to retrieve all the events that were sent.

Is there a way to make sure my tests remain stable and work even when executed with others or through `tox`?

Thanks in advance!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.