Flaky test TestSearchTagValuesV2
#4578
Labels
good first issue
Good for newcomers
help wanted
Extra attention is needed
type/bug
Something isn't working
TestSearchTagValuesV2/second_batch_with_incomplete_query_-_name
sometimes fails, and it appears this may be tied to the timing of block compaction.Example of a failing run: https://github.com/grafana/tempo/actions/runs/12831739931/job/35782895220
Observations
https://github.com/grafana/tempo/blob/main/modules/ingester/instance_search.go#L462
len(instance.completeBlocks)=0
before the test:len(instance.completeBlocks)=1
before the test:It seems that if block compaction triggers after the test traces are added but before querying tags, the test fails. When
searchBlockWithCache
runs, it appears to add entries from the block without filtering, which might be causing the unexpected extra result ("bar").Example Logs
Successful run
Failed run
Conclusion
Based on these observations, it looks like the test may fail when the data is queried from a block in the
completeBlocks
list - possibly because the block compaction step happens too soon andsearchBlockWithCache
does not filter entries correctly. I might be missing some implementation details, but wanted to report this in case it indicates a bug.The text was updated successfully, but these errors were encountered: