jaegertracing / jaeger

CNCF Jaeger, a Distributed Tracing Platform
https://www.jaegertracing.io/
Apache License 2.0
20.44k stars 2.44k forks source link

[Test Improvement]: Failing cassandra Intergation test for `FindTraces` subtest #4793

Open slayer321 opened 1 year ago

slayer321 commented 1 year ago

What happened?

Hi, Cassandra Integration test is failing for some of the subtest for TestCassandraStorage/FindTraces. For now I has been skipped on this PR. While testing it I have observe some of the reason why it is failing. Below I have describe it in more detail.

After looking more into the queryByDuration method I found that the reason for the first 3 test failing i.e

        --- FAIL: TestCassandraStorage/FindTraces/Operation_name_+_Duration_range (2.03s)
        --- FAIL: TestCassandraStorage/FindTraces/Duration_range (2.03s)
        --- FAIL: TestCassandraStorage/FindTraces/max_Duration (2.03s)

after the query is run the duration range doesn't match for the above 3 test . If we check the query and the min and max Duration , the max Duration are greater than what is been store in the duration_index table inside the cassandra DB . As we have this condition AND duration > ? AND duration < ? on the query it failed to get the trace ID as the duration for the above 3 test query should be as follow AND duration >= ? AND duration < ? to get it passed.

For the above first 2 test it is observe that the duration is stored as 5 microsecond inside the cassandra DB which is expected because if we check the trace file for both the test the duration is 5000ns(which get's converted to 5 microsecond) which can be seen here opname_dur_trace, dur_trace. Now if we check the min and max Duration which is also 5 microsecond for both the test and that is the reason cassandra DB query is not getting satisfied.

I'm not sure if we want to make changes to the query file ,so that condition is satisfied or to the DB query itself.

Steps to reproduce

  1. Run the Cassandra test
  2. The Above mentioned 3 subtest failed for FindTraces

Expected behavior

Above 3 test should pass

Relevant log output

No response

Screenshot

No response

Additional context

No response

Jaeger backend version

v1.49.0

SDK

No response

Pipeline

No response

Stogage backend

Cassandra

Operating system

Linux

Deployment model

No response

Deployment configs

No response

akstron commented 2 months ago

Hi @slayer321 I suggest that we should modify the query with AND duration >= ? AND duration <= ?. Going by the name of the query I assume that the duration search should be inclusive of the ranges i.e., [x, y], while for the current written query the limits are exclusive i.e, (x, y). /cc @yurishkuro