(t *testing.T)
| 2779 | } |
| 2780 | |
| 2781 | func TestSlowQueries(t *testing.T) { |
| 2782 | t.Parallel() |
| 2783 | ctx := user.InjectOrgID(context.Background(), "user") |
| 2784 | nameMatcher := mustEqualMatcher(model.MetricNameLabel, "foo") |
| 2785 | nIngesters := 3 |
| 2786 | for _, shardByAllLabels := range []bool{true, false} { |
| 2787 | for happy := 0; happy <= nIngesters; happy++ { |
| 2788 | shardByAllLabels := shardByAllLabels |
| 2789 | happy := happy |
| 2790 | t.Run(fmt.Sprintf("%t/%d", shardByAllLabels, happy), func(t *testing.T) { |
| 2791 | t.Parallel() |
| 2792 | var expectedErr error |
| 2793 | if nIngesters-happy > 1 { |
| 2794 | expectedErr = errFail |
| 2795 | } |
| 2796 | |
| 2797 | ds, _, _, _ := prepare(t, prepConfig{ |
| 2798 | numIngesters: nIngesters, |
| 2799 | happyIngesters: happy, |
| 2800 | numDistributors: 1, |
| 2801 | queryDelay: 100 * time.Millisecond, |
| 2802 | shardByAllLabels: shardByAllLabels, |
| 2803 | }) |
| 2804 | |
| 2805 | _, err := ds[0].QueryStream(ctx, 0, 10, false, nameMatcher) |
| 2806 | assert.Equal(t, expectedErr, err) |
| 2807 | }) |
| 2808 | } |
| 2809 | } |
| 2810 | } |
| 2811 | |
| 2812 | func TestDistributor_MetricsForLabelMatchers_SingleSlowIngester(t *testing.T) { |
| 2813 | t.Parallel() |
nothing calls this directly
no test coverage detected