@@ -370,12 +370,8 @@ class PythonWithGlobalInstSpanTests(tests.MySQLConnectorTests):
370
370
new_user_name = "ramon"
371
371
new_user_password = "s3cr3t"
372
372
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"
379
375
table_name = "employees"
380
376
create_stmt = f"""CREATE TABLE { table_name } (
381
377
emp_no int,
@@ -412,7 +408,7 @@ def setUp(self) -> None:
412
408
self .provider .add_span_processor (processor )
413
409
self .tracer = trace .get_tracer (__name__ , tracer_provider = self .provider )
414
410
self .cnx_config = self .get_clean_mysql_config ()
415
- self .server_host = self .cnx_config [' host' ]
411
+ self .server_host = self .cnx_config [" host" ]
416
412
self .cnx_config ["use_pure" ] = self .pure_python
417
413
418
414
# Instrumentor
@@ -555,9 +551,11 @@ def _run_client_app1(
555
551
app span or not.
556
552
"""
557
553
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
+ ):
561
559
cnx = self ._otel_connect (** self .cnx_config )
562
560
563
561
with cnx .cursor (** cur_kwargs ) as cur :
@@ -570,7 +568,9 @@ def _run_client_app1(
570
568
cur .execute (f"DROP TABLE IF EXISTS { self .table_name } " )
571
569
572
570
# 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
+ )
574
574
cur .execute (
575
575
self .new_user_stmt .format (
576
576
new_user_name = self .new_user_name ,
@@ -612,9 +612,11 @@ def _run_client_app2(
612
612
table_name = "my_table"
613
613
proc_name = "my_procedure"
614
614
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
+ ):
618
620
cnx = self ._otel_connect (** self .cnx_config )
619
621
620
622
with cnx .cursor (** cur_kwargs ) as cur :
@@ -731,7 +733,8 @@ def _check_error_event(self, span: DbDocType, ex: Exception) -> None:
731
733
events ["exception" ]["exception.message" ]["string_value" ], str (ex )
732
734
)
733
735
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__ } " ,
735
738
)
736
739
737
740
def test_connection_error (self ) -> None :
@@ -1002,6 +1005,10 @@ def test_local_uninstrumentation(self) -> None:
1002
1005
cnx .close ()
1003
1006
1004
1007
1008
+ @unittest .skipIf (
1009
+ True ,
1010
+ reason = "Deactivating it. Fails may happen depending on the machine workload. It can be misleading." ,
1011
+ )
1005
1012
class PythonPerformanceTests (tests .MySQLConnectorTests ):
1006
1013
"""Compare the connector's performance when otel tracing is on/off."""
1007
1014
@@ -1146,6 +1153,10 @@ def test_benchmark3(self):
1146
1153
)
1147
1154
1148
1155
1156
+ @unittest .skipIf (
1157
+ True ,
1158
+ reason = "Deactivating it. Fails may happen depending on the machine workload. It can be misleading." ,
1159
+ )
1149
1160
@unittest .skipIf (HAVE_CEXT == False , reason = NO_CEXT_ERR )
1150
1161
class CextPerformanceTests (PythonPerformanceTests ):
1151
1162
"""Compare the connector's performance when otel tracing is on/off."""
0 commit comments