MCPcopy
hub / github.com/grafana/tempo / TestPollComparePreviousResults

Function TestPollComparePreviousResults

tempodb/blocklist/poller_test.go:774–1092  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

772}
773
774func TestPollComparePreviousResults(t *testing.T) {
775 zero := backend.MustParse("00000000-0000-0000-0000-000000000000")
776 aaa := backend.MustParse("00000000-0000-0000-0000-00000000000A")
777 eff := backend.MustParse("00000000-0000-0000-0000-00000000000F")
778
779 testCases := []struct {
780 name string
781
782 previousPerTenant PerTenant
783 previousCompactedPerTenant PerTenantCompacted
784
785 currentPerTenant PerTenant
786 currentCompactedPerTenant PerTenantCompacted
787
788 expectedPerTenant PerTenant
789 expectedCompactedPerTenant PerTenantCompacted
790
791 expectedBlockMetaCalls map[string]map[uuid.UUID]int
792 expectedCompactedBlockMetaCalls map[string]map[uuid.UUID]int
793
794 tollerateErrors int
795 tollerateTenantFailures int
796
797 readerErr bool
798 err error
799 }{
800 {
801 name: "with no previous results, the blocklist is polled",
802 previousPerTenant: PerTenant{},
803 previousCompactedPerTenant: PerTenantCompacted{},
804 currentPerTenant: PerTenant{
805 "test": []*backend.BlockMeta{
806 {BlockID: zero},
807 },
808 },
809 currentCompactedPerTenant: PerTenantCompacted{
810 "test": []*backend.CompactedBlockMeta{
811 {BlockMeta: backend.BlockMeta{BlockID: eff}},
812 },
813 },
814 expectedPerTenant: PerTenant{
815 "test": []*backend.BlockMeta{
816 {BlockID: zero},
817 },
818 },
819 expectedCompactedPerTenant: PerTenantCompacted{
820 "test": []*backend.CompactedBlockMeta{
821 {BlockMeta: backend.BlockMeta{BlockID: eff}},
822 },
823 },
824 expectedBlockMetaCalls: map[string]map[uuid.UUID]int{
825 "test": {
826 (uuid.UUID)(zero): 1,
827 },
828 },
829 expectedCompactedBlockMetaCalls: map[string]map[uuid.UUID]int{
830 "test": {
831 (uuid.UUID)(eff): 1,

Callers

nothing calls this directly

Calls 9

DoMethod · 0.95
MustParseFunction · 0.92
newMockCompactorFunction · 0.85
newMockReaderFunction · 0.85
newBlocklistFunction · 0.85
NewPollerFunction · 0.85
RunMethod · 0.45
EqualMethod · 0.45
CompareMethod · 0.45

Tested by

no test coverage detected