Skip to content

Commit 848779b

Browse files
authored
Merge pull request grpc#20050 from rmstar/shutdown_crash
timer_test: add test case for grpc shutdown while timer is pending
2 parents da21d8b + 2b9ab6d commit 848779b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/cpp/common/timer_test.cc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,20 @@ TEST_F(TimerTest, CancelSomeTimers) {
155155
gpr_log(GPR_DEBUG, "wakeups: %" PRId64 "", wakeups);
156156
}
157157

158+
// Enable the following test after
159+
// https://github.com/grpc/grpc/issues/20049 has been fixed.
160+
#if 0
161+
TEST_F(TimerTest, TimerNotCanceled) {
162+
grpc_core::ExecCtx exec_ctx;
163+
grpc_timer timer;
164+
grpc_timer_init(&timer, 10000,
165+
GRPC_CLOSURE_CREATE(
166+
[](void*, grpc_error*) {
167+
},
168+
nullptr, grpc_schedule_on_exec_ctx));
169+
}
170+
#endif
171+
158172
int main(int argc, char** argv) {
159173
grpc::testing::TestEnvironment env(argc, argv);
160174
::testing::InitGoogleTest(&argc, argv);

0 commit comments

Comments
 (0)