Skip to content

Comments

test: stabilize coverage for lua filter.#18927

Merged
yanavlasov merged 1 commit intoenvoyproxy:mainfrom
tkovacs-2:lua_filter_coverage
Nov 10, 2021
Merged

test: stabilize coverage for lua filter.#18927
yanavlasov merged 1 commit intoenvoyproxy:mainfrom
tkovacs-2:lua_filter_coverage

Conversation

@tkovacs-2
Copy link
Contributor

@tkovacs-2 tkovacs-2 commented Nov 8, 2021

Commit Message: Add test for lua FilterConfigPerRoute dtor called on worker thread.

Additional Description:
There is a conditional block in ~FilterConfigPerRoute.
Only the testcase LuaIntegrationTest.RdsTestOfLuaPerRoute generates coverage there but even that depends on scheduling:
Every thread has a shared pointer to the route config including the per route lua script.
When the RDS updates the routing, all threads assign the new value to the shared pointer.
It is not predictable which will do the last assignment and actually call the destructor of the previous pointed route config.
If last one is worker thread the block is covered if not it is not covered.
(For validation, some delay in the lamda at the beginning of Envoy::Router::RdsRouteConfigProviderImpl::onConfigUpdate() like { if (factory_context_.mainThreadDispatcher().isThreadSafe()) {sleep(3);} tls->config = ... } will make the uncovered case permanent)

If the conditional block in ~FilterConfigPerRoute is accidentally uncovered then the per folder coverage is dropped below limit and the causes sporadic CI failure.
New test is added to ensure coverage is generated in every run.

Risk Level: None
Testing: New testcase is added.
Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A

@yanavlasov yanavlasov merged commit 493fa15 into envoyproxy:main Nov 10, 2021
mpuncel added a commit to mpuncel/envoy that referenced this pull request Nov 10, 2021
* main: (71 commits)
  bazel: fix macOS build (envoyproxy#18920)
  http: switching from 100 to 1xx (envoyproxy#18904)
  grpc: implement BufferedAsyncClient for bidirectional gRPC stream (envoyproxy#18129)
  bazel: add repository arg to benchmark_test (envoyproxy#18795)
  rocketmq_proxy: Improvement for map find (envoyproxy#18909)
  tls: unit test: spiffe signed by intermediate cert (envoyproxy#18914)
  Test for FilterConfigPerRoute dtor called on worker thread. (envoyproxy#18927)
  deps: Bump `com_google_protobuf` -> 3.19.1 (envoyproxy#18930)
  deps: Bump `com_googlesource_code_re2` -> 2021-11-01 (envoyproxy#18933)
  cvescan: Move cvescan data to yaml (envoyproxy#18947)
  remove unnecessary file level not unimplemented hide annotation (envoyproxy#18924)
  test: moving echo test (envoyproxy#18938)
  test: fixing a test flake (envoyproxy#18899)
  deps: Revert pyparsing bump (envoyproxy#18946)
  deps: Bump `build_bazel_rules_apple` -> 0.32.0 (envoyproxy#18932)
  deps: Bump `com_github_bazelbuild_buildtools` -> 4.2.3 (envoyproxy#18931)
  build(deps): bump pycparser from 2.20 to 2.21 in /tools/dependency (envoyproxy#18936)
  quic: supporting connections with zero initial available streams (envoyproxy#18775)
  test: moving proxy proto (envoyproxy#18939)
  build(deps): bump pyparsing from 3.0.4 to 3.0.5 in /tools/dependency (envoyproxy#18937)
  ...

Signed-off-by: Michael Puncel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants