diff options
author | Quang-Minh Nguyen <qmnguyen@gitlab.com> | 2023-09-20 08:46:56 +0300 |
---|---|---|
committer | Quang-Minh Nguyen <qmnguyen@gitlab.com> | 2023-09-20 08:46:56 +0300 |
commit | 0a7e89fde7ab1745eebf9c7fd2299047e293d9ef (patch) | |
tree | 23941d17ad869aa972d043d9b86cb09623f1f9e9 | |
parent | 97ce3c032c2798dc5705713cbed0ccc4b41d3bd0 (diff) | |
parent | 2e374db4ad630257262a86d6aabcee285941155b (diff) |
Merge branch 'qmnguyen0711/fix-calculator-tests-v2' into 'master'
Flaky tests: Fix TestAdaptiveCalculator flaky tests (second take)
See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/6381
Merged-by: Quang-Minh Nguyen <qmnguyen@gitlab.com>
Approved-by: Justin Tobler <jtobler@gitlab.com>
-rw-r--r-- | internal/limiter/adaptive_calculator_test.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/internal/limiter/adaptive_calculator_test.go b/internal/limiter/adaptive_calculator_test.go index 8da85704d..48c4c71c3 100644 --- a/internal/limiter/adaptive_calculator_test.go +++ b/internal/limiter/adaptive_calculator_test.go @@ -54,8 +54,6 @@ func TestAdaptiveCalculator_realTimerTicker(t *testing.T) { func TestAdaptiveCalculator(t *testing.T) { t.Parallel() - testhelper.SkipQuarantinedTest(t, "https://gitlab.com/gitlab-org/gitaly/-/issues/5467") - tests := []struct { desc string limits []AdaptiveLimiter @@ -555,7 +553,11 @@ gitaly_concurrency_limiting_watcher_errors_total{watcher="testWatcher2"} 5 close(tickerDone) }) - calibration := 10 * time.Millisecond + // This test setup uses a manual ticker. This calibration duration is irrelevant to the actual + // calibration cycle of the calculation. However, the calculator uses this value to determine a + // timeout when polling events from the watchers. Thus, we need to pass an unrealistically high + // value. Otherwise, the tests might be flaky when running on slow machines. + calibration := 1 * time.Hour calculator := NewAdaptiveCalculator(calibration, logger, tc.limits, tc.watchers) calculator.tickerCreator = func(duration time.Duration) helper.Ticker { return ticker } |