open-telemetry / open-telemetry/opentelemetry-python-contrib

Flaky redis docker test

Open
#4,589 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.1k
Forks
1.1k
Avg merge
4d 15h
Merged PRs (30d)
16

Description

__________________ TestRedisearchInstrument.test_redis_query ___________________

self = <test_redis_functional.TestRedisearchInstrument testMethod=test_redis_query>

    def test_redis_query(self):
        query = "@name:test"
        self.redis_client.ft("idx:test_vss").search(Query(query))
    
        spans = self.memory_exporter.get_finished_spans()
        span = next(span for span in spans if span.name == "redis.search")
    
        assert span.attributes.get("redis.search.query") == query
>       assert span.attributes.get("redis.search.total") == 1
E       AssertionError: assert 0 == 1
E        +  where 0 = <built-in method get of mappingproxy object at 0x7f23dba49f90>('redis.search.total')
E        +    where <built-in method get of mappingproxy object at 0x7f23dba49f90> = mappingproxy({'db.statement': 'FT.SEARCH ? ? ? ? ?', 'db.redis.args_length': 6, 'db.system': 'redis', 'db.redis.database_index': 0, 'net.peer.name': 'localhost', 'net.peer.port': 6379, 'net.transport': 'ip_tcp', 'redis.search.index': 'idx:test_vss', 'redis.search.query': '@name:test', 'redis.search.total': 0}).get
E        +      where mappingproxy({'db.statement': 'FT.SEARCH ? ? ? ? ?', 'db.redis.args_length': 6, 'db.system': 'redis', 'db.redis.database_index': 0, 'net.peer.name': 'localhost', 'net.peer.port': 6379, 'net.transport': 'ip_tcp', 'redis.search.index': 'idx:test_vss', 'redis.search.query': '@name:test', 'redis.search.total': 0}) = <opentelemetry.sdk.trace.ReadableSpan object at 0x7f23d9072410>.attributes

Contributor guide

Open the contributing guide

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 with TestRedisearchInstrument.test_redis_query and its failing redis.search.total assertion; run the Redis Docker test to reproduce whether the expected search result is available before the query. Done means the test is deterministic and consistently observes the expected total without weakening the instrumentation assertion.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, python, redis
Domain
databases, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.