From f68ee1e1e26b003c69549542af0f792127c01cee Mon Sep 17 00:00:00 2001 From: Sunjay Bhatia <5337253+sunjayBhatia@users.noreply.github.com> Date: Tue, 25 May 2021 17:30:00 -0400 Subject: [PATCH] Fix flaky test TestServiceLegacy (#258) User deferred barrier.signal() so panic definitely occurs before we continue on in test. Config reload uses recover() and increments config load counter, tests were failing to see config load error counter increment. Fixes: #256 Signed-off-by: Sunjay Bhatia Signed-off-by: bstorozhuk --- test/service/ratelimit_legacy_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/service/ratelimit_legacy_test.go b/test/service/ratelimit_legacy_test.go index a51ddbe9..d90f202e 100644 --- a/test/service/ratelimit_legacy_test.go +++ b/test/service/ratelimit_legacy_test.go @@ -121,7 +121,7 @@ func TestServiceLegacy(test *testing.T) { t.configLoader.EXPECT().Load( []config.RateLimitConfigToLoad{{"config.basic_config", "fake_yaml"}}, gomock.Any()).Do( func([]config.RateLimitConfigToLoad, stats.Scope) { - barrier.signal() + defer barrier.signal() panic(config.RateLimitConfigError("load error")) }) t.runtimeUpdateCallback <- 1