Skip to content

Commit

Permalink
Fix flaky test TestServiceLegacy (envoyproxy#258)
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 <[email protected]>
Signed-off-by: bstorozhuk <[email protected]>
  • Loading branch information
sunjayBhatia authored and storozhukBM committed May 28, 2021
1 parent 16d93e9 commit f68ee1e
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 f68ee1e

Please sign in to comment.