@@ -4845,107 +4845,6 @@ TEST_F(ListenerManagerImplForInPlaceFilterChainUpdateTest,
4845
4845
EXPECT_EQ (0 , server_.stats_store_ .counter (" listener_manager.listener_in_place_updated" ).value ());
4846
4846
}
4847
4847
4848
- // This test execute an in place update first, then a traditional listener update.
4849
- // The second update is enforced by runtime.
4850
- TEST_F (ListenerManagerImplTest, RuntimeDisabledInPlaceUpdateFallbacksToTraditionalUpdate) {
4851
- InSequence s;
4852
- EXPECT_CALL (*worker_, start (_));
4853
- manager_->startWorkers (guard_dog_, callback_.AsStdFunction ());
4854
-
4855
- // Add foo listener.
4856
- const std::string listener_foo_yaml = R"EOF(
4857
- name: foo
4858
- address:
4859
- socket_address:
4860
- address: 127.0.0.1
4861
- port_value: 1234
4862
- filter_chains:
4863
- - filters: []
4864
- )EOF" ;
4865
-
4866
- ListenerHandle* listener_foo = expectListenerCreate (false , true );
4867
- EXPECT_CALL (listener_factory_, createListenSocket (_, _, _, {true }));
4868
-
4869
- EXPECT_CALL (*worker_, addListener (_, _, _));
4870
-
4871
- EXPECT_TRUE (manager_->addOrUpdateListener (parseListenerFromV3Yaml (listener_foo_yaml), " " , true ));
4872
- EXPECT_EQ (0 , server_.stats_store_ .counter (" listener_manager.listener_in_place_updated" ).value ());
4873
-
4874
- worker_->callAddCompletion (true );
4875
- EXPECT_EQ (1UL , manager_->listeners ().size ());
4876
- checkStats (__LINE__, 1 , 0 , 0 , 0 , 1 , 0 , 0 );
4877
-
4878
- // Add foo listener again. Will execute in place filter chain update path.
4879
- const std::string listener_foo_update1_yaml = R"EOF(
4880
- name: foo
4881
- address:
4882
- socket_address:
4883
- address: 127.0.0.1
4884
- port_value: 1234
4885
- filter_chains:
4886
- - filters: []
4887
- filter_chain_match:
4888
- destination_port: 1234
4889
- )EOF" ;
4890
-
4891
- ListenerHandle* listener_foo_update1 = expectListenerOverridden (false , listener_foo);
4892
- EXPECT_CALL (*worker_, addListener (_, _, _));
4893
- auto * timer = new Event::MockTimer (dynamic_cast <Event::MockDispatcher*>(&server_.dispatcher ()));
4894
- EXPECT_CALL (*timer, enableTimer (_, _));
4895
- EXPECT_TRUE (
4896
- manager_->addOrUpdateListener (parseListenerFromV3Yaml (listener_foo_update1_yaml), " " , true ));
4897
- EXPECT_EQ (1 , server_.stats_store_ .counter (" listener_manager.listener_in_place_updated" ).value ());
4898
-
4899
- EXPECT_EQ (1UL , manager_->listeners ().size ());
4900
- worker_->callAddCompletion (true );
4901
-
4902
- EXPECT_CALL (*worker_, removeFilterChains (_, _, _));
4903
- timer->invokeCallback ();
4904
- EXPECT_CALL (*listener_foo, onDestroy ());
4905
- worker_->callDrainFilterChainsComplete ();
4906
-
4907
- // Update foo again. This time we disable in place filter chain update in runtime.
4908
- // The traditional full listener update path is used.
4909
- auto in_place_update_disabled_guard = disableInplaceUpdateForThisTest ();
4910
- const std::string listener_foo_update2_yaml = R"EOF(
4911
- name: foo
4912
- address:
4913
- socket_address:
4914
- address: 127.0.0.1
4915
- port_value: 1234
4916
- filter_chains:
4917
- - filters:
4918
- filter_chain_match:
4919
- destination_port: 2345
4920
- )EOF" ;
4921
-
4922
- ListenerHandle* listener_foo_update2 = expectListenerCreate (false , true );
4923
- EXPECT_CALL (*worker_, addListener (_, _, _));
4924
- EXPECT_CALL (*worker_, stopListener (_, _));
4925
- EXPECT_CALL (*listener_foo_update1->drain_manager_ , startDrainSequence (_));
4926
- EXPECT_TRUE (
4927
- manager_->addOrUpdateListener (parseListenerFromV3Yaml (listener_foo_update2_yaml), " " , true ));
4928
- EXPECT_EQ (1 , server_.stats_store_ .counter (" listener_manager.listener_in_place_updated" ).value ());
4929
-
4930
- EXPECT_CALL (*worker_, removeListener (_, _));
4931
- listener_foo_update1->drain_manager_ ->drain_sequence_completion_ ();
4932
-
4933
- EXPECT_CALL (*listener_foo_update1, onDestroy ());
4934
- worker_->callRemovalCompletion ();
4935
-
4936
- EXPECT_CALL (*worker_, stopListener (_, _));
4937
- EXPECT_CALL (*listener_factory_.socket_ , close ());
4938
- EXPECT_CALL (*listener_foo_update2->drain_manager_ , startDrainSequence (_));
4939
- EXPECT_TRUE (manager_->removeListener (" foo" ));
4940
-
4941
- EXPECT_CALL (*worker_, removeListener (_, _));
4942
- listener_foo_update2->drain_manager_ ->drain_sequence_completion_ ();
4943
-
4944
- EXPECT_CALL (*listener_foo_update2, onDestroy ());
4945
- worker_->callRemovalCompletion ();
4946
- EXPECT_EQ (0UL , manager_->listeners ().size ());
4947
- }
4948
-
4949
4848
// This test verifies that on default initialization the UDP Packet Writer
4950
4849
// is initialized in passthrough mode. (i.e. by using UdpDefaultWriter).
4951
4850
TEST_F (ListenerManagerImplTest, UdpDefaultWriterConfig) {
0 commit comments