@ -15,6 +15,7 @@
# include "test/core/filters/filter_test.h"
# include <algorithm>
# include <chrono>
# include <memory>
# include <queue>
@ -24,8 +25,11 @@
# include "absl/types/optional.h"
# include "gtest/gtest.h"
# include <grpc/grpc.h>
# include "src/core/lib/channel/call_finalization.h"
# include "src/core/lib/channel/context.h"
# include "src/core/lib/event_engine/default_event_engine.h"
# include "src/core/lib/gprpp/crash.h"
# include "src/core/lib/iomgr/timer_manager.h"
# include "src/core/lib/promise/activity.h"
@ -38,6 +42,9 @@
# include "src/core/lib/slice/slice.h"
# include "test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.pb.h"
using grpc_event_engine : : experimental : : FuzzingEventEngine ;
using grpc_event_engine : : experimental : : GetDefaultEventEngine ;
namespace grpc_core {
///////////////////////////////////////////////////////////////////////////////
@ -415,20 +422,27 @@ void FilterTestBase::Call::FinishNextFilter(ServerMetadataHandle md) {
///////////////////////////////////////////////////////////////////////////////
// FilterTestBase
FilterTestBase : : FilterTestBase ( )
: event_engine_ (
[ ] ( ) {
grpc_timer_manager_set_threading ( false ) ;
grpc_event_engine : : experimental : : FuzzingEventEngine : : Options
options ;
return options ;
} ( ) ,
fuzzing_event_engine : : Actions ( ) ) { }
FilterTestBase : : FilterTestBase ( ) {
grpc_event_engine : : experimental : : SetEventEngineFactory ( [ ] ( ) {
FuzzingEventEngine : : Options options ;
options . max_delay_run_after = std : : chrono : : milliseconds ( 500 ) ;
options . max_delay_write = std : : chrono : : milliseconds ( 50 ) ;
return std : : make_unique < FuzzingEventEngine > (
options , fuzzing_event_engine : : Actions ( ) ) ;
} ) ;
event_engine_ =
std : : dynamic_pointer_cast < FuzzingEventEngine > ( GetDefaultEventEngine ( ) ) ;
grpc_timer_manager_set_start_threaded ( false ) ;
grpc_init ( ) ;
}
FilterTestBase : : ~ FilterTestBase ( ) { event_engine_ . UnsetGlobalHooks ( ) ; }
FilterTestBase : : ~ FilterTestBase ( ) {
grpc_shutdown ( ) ;
event_engine_ - > UnsetGlobalHooks ( ) ;
}
void FilterTestBase : : Step ( ) {
event_engine_ . TickUntilIdle ( ) ;
event_engine_ - > TickUntilIdle ( ) ;
: : testing : : Mock : : VerifyAndClearExpectations ( & events ) ;
}