call mtr.add_suppression("Allocation failed"); SET @old_debug= @@session.debug; set @old_thread_cache_size=@@global.thread_cache_size; select 1; 1 1 set global debug_dbug='+d,simulate_failed_connection_1'; connect(localhost,root,,test,MASTER_PORT,MASTER_SOCKET); Got one of the listed errors set global debug_dbug=@old_debug; set global debug_dbug='+d,simulate_failed_connection_2'; connect(localhost,root,,test,MASTER_PORT,MASTER_SOCKET); Got one of the listed errors set global debug_dbug=@old_debug; select 1; 1 1 select 1; 1 1 set global debug_dbug='+d,simulate_failed_connection_1'; connect(localhost,root,,test,MASTER_PORT,MASTER_SOCKET); Got one of the listed errors set global debug_dbug=@old_debug; set global debug_dbug='+d,simulate_failed_connection_2'; connect(localhost,root,,test,MASTER_PORT,MASTER_SOCKET); Got one of the listed errors set global debug_dbug=@old_debug; select 1; 1 1 set @@global.thread_cache_size=2; select 1; 1 1 select 1; 1 1 set global debug_dbug='+d,simulate_failed_connection_2'; connect(localhost,root,,test,MASTER_PORT,MASTER_SOCKET); Got one of the listed errors show status like "Threads_connected"; Variable_name Value Threads_connected 1 set global debug_dbug=@old_debug; set global thread_cache_size=@old_thread_cache_size;