Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ananda1066 committed Jun 20, 2024
1 parent 1e9cbf8 commit 44bd4b1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void CreateSockets(int sv[2]) {
}

EndpointPair CreateEndpointPair(grpc_core::ChannelArgs& args,
ThreadPool* thread_pool) {
GRPC_UNUSED ThreadPool* thread_pool) {
std::unique_ptr<EventEngine::Endpoint> client_endpoint = nullptr;
std::unique_ptr<EventEngine::Endpoint> server_endpoint = nullptr;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
#include <grpc/event_engine/event_engine.h>

#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/event_engine/channel_args_endpoint_config.h"
#include "src/core/lib/event_engine/default_event_engine.h"
#include "src/core/lib/event_engine/thread_pool/thread_pool.h"
#include "src/core/lib/event_engine/windows/win_socket.h"
#include "src/core/lib/event_engine/windows/windows_endpoint.h"
Expand Down
27 changes: 3 additions & 24 deletions test/core/security/secure_endpoint_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ static void destroy_pollset(void* p, grpc_error_handle /*error*/) {
grpc_pollset_destroy(static_cast<grpc_pollset*>(p));
}

TEST(SecureEndpointTest, IomgrEndpointTest) {
TEST(SecureEndpointTest, MainTest) {
grpc_closure destroyed;
grpc_init();

Expand All @@ -362,33 +362,13 @@ TEST(SecureEndpointTest, IomgrEndpointTest) {
test_leftover(configs[2], 1);
test_leftover(configs[3], 1);

GRPC_CLOSURE_INIT(&destroyed, destroy_pollset, g_pollset,
grpc_schedule_on_exec_ctx);
grpc_pollset_shutdown(g_pollset, &destroyed);
g_thread_pool->Quiesce();
}

grpc_shutdown();

gpr_free(g_pollset);
}

TEST(SecureEndpointTest, EventEngineEndpointTest) {
g_event_engine_secure_endpoint_enabled = true;
grpc_closure destroyed;
grpc_init();

{
grpc_core::ExecCtx exec_ctx;
g_thread_pool = MakeThreadPool(8);
g_pollset = static_cast<grpc_pollset*>(gpr_zalloc(grpc_pollset_size()));
grpc_pollset_init(g_pollset, &g_mu);

// Run tests with EventEngine-based secure endpoint.
g_event_engine_secure_endpoint_enabled = true;
grpc_endpoint_tests(configs[0], g_pollset, g_mu);
grpc_endpoint_tests(configs[1], g_pollset, g_mu);
test_leftover(configs[2], 1);
test_leftover(configs[3], 1);
g_event_engine_secure_endpoint_enabled = false;

GRPC_CLOSURE_INIT(&destroyed, destroy_pollset, g_pollset,
grpc_schedule_on_exec_ctx);
Expand All @@ -399,7 +379,6 @@ TEST(SecureEndpointTest, EventEngineEndpointTest) {
grpc_shutdown();

gpr_free(g_pollset);
g_event_engine_secure_endpoint_enabled = false;
}

int main(int argc, char** argv) {
Expand Down

0 comments on commit 44bd4b1

Please sign in to comment.