Skip to content

Commit

Permalink
Fix flaky test TestServiceLegacy
Browse files Browse the repository at this point in the history
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: envoyproxy#256

Signed-off-by: Sunjay Bhatia <sunjayb@vmware.com>
  • Loading branch information
sunjayBhatia committed May 25, 2021
1 parent bc0e9fa commit de4ccf8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/service/ratelimit_legacy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit de4ccf8

Please sign in to comment.