From cebcb15ba44710a2ec65538b369127325484519a Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Sat, 11 Sep 2021 10:57:13 +0300 Subject: [PATCH] lib/storage: verify that the tsidsFound contain the needed tsids in tests added at f4dead529f5e10a5ed2c12cadf4d5d23bc28bed4 --- lib/storage/index_db_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/storage/index_db_test.go b/lib/storage/index_db_test.go index 53d3ae9e3c..6635c04263 100644 --- a/lib/storage/index_db_test.go +++ b/lib/storage/index_db_test.go @@ -887,6 +887,9 @@ func testIndexDBCheckTSIDByName(db *indexDB, mns []MetricName, tsids []TSID, isC if err != nil { return fmt.Errorf("cannot search with a filter matching empty tag: %w", err) } + if !testHasTSID(tsidsFound, tsid) { + return fmt.Errorf("tsids is missing when matching a filter with empty tag tsidsFound\ntsid=%+v\ntsidsFound=%+v\ntfs=%s\nmn=%s", tsid, tsidsFound, tfs, mn) + } // Search with filters matching empty tags (multiple filters) // See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1601 @@ -904,6 +907,9 @@ func testIndexDBCheckTSIDByName(db *indexDB, mns []MetricName, tsids []TSID, isC if err != nil { return fmt.Errorf("cannot search with multipel filters matching empty tags: %w", err) } + if !testHasTSID(tsidsFound, tsid) { + return fmt.Errorf("tsids is missing when matching multiple filters with empty tags tsidsFound\ntsid=%+v\ntsidsFound=%+v\ntfs=%s\nmn=%s", tsid, tsidsFound, tfs, mn) + } // Search with regexps. tfs.Reset()