From 510978dbbc0145b2a18c950f01bfd51f5a3b471f Mon Sep 17 00:00:00 2001 From: Adrianna Chang Date: Thu, 26 Oct 2023 14:31:45 -0400 Subject: [PATCH] Fix connection error message regexp for Mysql2 In CI, sometimes the Mysql2 error message for a lost connection doesn't include "MySQL server", it says "Lost connection to server". This commit makes the "MySQL" part of the regexp optional. Co-authored-by: Nikita Vasilevsky --- lib/semian/mysql2.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/semian/mysql2.rb b/lib/semian/mysql2.rb index db1f9382..31d41045 100644 --- a/lib/semian/mysql2.rb +++ b/lib/semian/mysql2.rb @@ -22,8 +22,8 @@ module Mysql2 include Semian::Adapter CONNECTION_ERROR = Regexp.union( - /Can't connect to MySQL server on/i, - /Lost connection to MySQL server/i, + /Can't connect to (?:MySQL )?server on/i, + /Lost connection to (?:MySQL )?server/i, /MySQL server has gone away/i, /Too many connections/i, /closed MySQL connection/i,