man-group / man-group/pytest-plugins

Redis server not launched - hangs waiting for connection

Open
#63 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
Python
Stars
597
Forks
89
PR merge metrics
No merged PRs in 30d

Description

Steps to reproduce:

```
virtualenv -p python3.6 test_dummy_env
source test_dummy_env/bin/activate
pip install pytest-server-fixtures redis
```

```python
# testit.py
def test_it(redis_server):
redis_server.api.set('key', 1)
assert redis_server.api.get('key') == 1
```

```
$ pytest testit.py --fulltrace -s
======================================================================================================================== test session starts =========================================================================================================================
platform linux -- Python 3.6.1, pytest-3.1.3, py-1.4.34, pluggy-0.4.0
rootdir: /home/rob/code/observer, inifile: pytest.ini
plugins: shutil-1.2.11, server-fixtures-1.2.11
collected 1 item s

testit.py pinging Redis at 127.75.17.85:20407 db 0
server not up yet (Error 111 connecting to 127.75.17.85:20407. Connection refused.)
pinging Redis at 127.75.17.85:20407 db 0
server not up yet (Error 111 connecting to 127.75.17.85:20407. Connection refused.)
pinging Redis at 127.75.17.85:20407 db 0
server not up yet (Error 111 connecting to 127.75.17.85:20407. Connection refused.)
pinging Redis at 127.75.17.85:20407 db 0
server not up yet (Error 111 connecting to 127.75.17.85:20407. Connection refused.)
pinging Redis at 127.75.17.85:20407 db 0
server not up yet (Error 111 connecting to 127.75.17.85:20407. Connection refused.)
pinging Redis at 127.75.17.85:20407 db 0
server not up yet (Error 111 connecting to 127.75.17.85:20407. Connection refused.)
pinging Redis at 127.75.17.85:20407 db 0
server not up yet (Error 111 connecting to 127.75.17.85:20407. Connection refused.)
```

`redis-server --version`
> Redis server v=3.0.6 sha=00000000:0 malloc=jemalloc-3.6.0 bits=64 build=687a2a319020fa42

`lsb_release -a`
```
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.2 LTS
Release: 16.04
Codename: xenial
```
-----

While pytest is running, if I check the process list, there's no `redis-server` process present.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with testit.py, pytest, and the redis_server fixture described in the report, then inspect the fixture's server-launch path. Done means the fixture starts a redis-server process and the shown test completes successfully instead of waiting indefinitely for a connection.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, redis
Domain
databases, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.