@@ -370,12 +370,8 @@ class PythonWithGlobalInstSpanTests(tests.MySQLConnectorTests):
370370 new_user_name = "ramon"
371371 new_user_password = "s3cr3t"
372372 new_database = "colors"
373- new_user_stmt = (
374- "CREATE USER '{new_user_name}'@'{server_host}' IDENTIFIED BY '{new_user_password}'"
375- )
376- grant_stmt = (
377- "GRANT ALL PRIVILEGES ON *.* TO '{new_user_name}'@'{server_host}' WITH GRANT OPTION"
378- )
373+ new_user_stmt = "CREATE USER '{new_user_name}'@'{server_host}' IDENTIFIED BY '{new_user_password}'"
374+ grant_stmt = "GRANT ALL PRIVILEGES ON *.* TO '{new_user_name}'@'{server_host}' WITH GRANT OPTION"
379375 table_name = "employees"
380376 create_stmt = f"""CREATE TABLE { table_name } (
381377 emp_no int,
@@ -412,7 +408,7 @@ def setUp(self) -> None:
412408 self .provider .add_span_processor (processor )
413409 self .tracer = trace .get_tracer (__name__ , tracer_provider = self .provider )
414410 self .cnx_config = self .get_clean_mysql_config ()
415- self .server_host = self .cnx_config [' host' ]
411+ self .server_host = self .cnx_config [" host" ]
416412 self .cnx_config ["use_pure" ] = self .pure_python
417413
418414 # Instrumentor
@@ -555,9 +551,11 @@ def _run_client_app1(
555551 app span or not.
556552 """
557553 num_query_spans_client_app = 13
558- with self .tracer .start_as_current_span (
559- "app"
560- ) if with_client_span else nullcontext ():
554+ with (
555+ self .tracer .start_as_current_span ("app" )
556+ if with_client_span
557+ else nullcontext ()
558+ ):
561559 cnx = self ._otel_connect (** self .cnx_config )
562560
563561 with cnx .cursor (** cur_kwargs ) as cur :
@@ -570,7 +568,9 @@ def _run_client_app1(
570568 cur .execute (f"DROP TABLE IF EXISTS { self .table_name } " )
571569
572570 # create a new user
573- cur .execute (f"DROP USER IF EXISTS '{ self .new_user_name } '@'{ self .server_host } '" )
571+ cur .execute (
572+ f"DROP USER IF EXISTS '{ self .new_user_name } '@'{ self .server_host } '"
573+ )
574574 cur .execute (
575575 self .new_user_stmt .format (
576576 new_user_name = self .new_user_name ,
@@ -612,9 +612,11 @@ def _run_client_app2(
612612 table_name = "my_table"
613613 proc_name = "my_procedure"
614614
615- with self .tracer .start_as_current_span (
616- "app"
617- ) if with_client_span else nullcontext ():
615+ with (
616+ self .tracer .start_as_current_span ("app" )
617+ if with_client_span
618+ else nullcontext ()
619+ ):
618620 cnx = self ._otel_connect (** self .cnx_config )
619621
620622 with cnx .cursor (** cur_kwargs ) as cur :
@@ -731,7 +733,8 @@ def _check_error_event(self, span: DbDocType, ex: Exception) -> None:
731733 events ["exception" ]["exception.message" ]["string_value" ], str (ex )
732734 )
733735 self .assertEqual (
734- events ["exception" ]["exception.type" ]["string_value" ], ex .__class__ .__name__
736+ events ["exception" ]["exception.type" ]["string_value" ],
737+ f"{ ex .__class__ .__module__ } .{ ex .__class__ .__name__ } " ,
735738 )
736739
737740 def test_connection_error (self ) -> None :
@@ -1002,6 +1005,10 @@ def test_local_uninstrumentation(self) -> None:
10021005 cnx .close ()
10031006
10041007
1008+ @unittest .skipIf (
1009+ True ,
1010+ reason = "Deactivating it. Fails may happen depending on the machine workload. It can be misleading." ,
1011+ )
10051012class PythonPerformanceTests (tests .MySQLConnectorTests ):
10061013 """Compare the connector's performance when otel tracing is on/off."""
10071014
@@ -1146,6 +1153,10 @@ def test_benchmark3(self):
11461153 )
11471154
11481155
1156+ @unittest .skipIf (
1157+ True ,
1158+ reason = "Deactivating it. Fails may happen depending on the machine workload. It can be misleading." ,
1159+ )
11491160@unittest .skipIf (HAVE_CEXT == False , reason = NO_CEXT_ERR )
11501161class CextPerformanceTests (PythonPerformanceTests ):
11511162 """Compare the connector's performance when otel tracing is on/off."""
0 commit comments