@@ -209,15 +209,15 @@ def test_process_config_full():
209209 "max_overflow" : 0 ,
210210 "pool_size" : 20 ,
211211 "pool_pre_ping" : True ,
212- "connect_args" : {"connect_timeout" : 1 },
212+ "connect_args" : {"connect_timeout" : 1 , "application_name" : "dbos_transact" },
213213 }
214214 assert configFile ["database" ]["sys_db_engine_kwargs" ] == {
215215 "key" : "value" ,
216216 "pool_timeout" : 30 ,
217217 "max_overflow" : 0 ,
218218 "pool_size" : 27 ,
219219 "pool_pre_ping" : True ,
220- "connect_args" : {"connect_timeout" : 1 },
220+ "connect_args" : {"connect_timeout" : 1 , "application_name" : "dbos_transact" },
221221 }
222222 assert configFile ["runtimeConfig" ]["start" ] == ["python3 main.py" ]
223223 assert configFile ["runtimeConfig" ]["admin_port" ] == 8001
@@ -255,15 +255,15 @@ def test_process_config_system_database():
255255 "max_overflow" : 0 ,
256256 "pool_size" : 20 ,
257257 "pool_pre_ping" : True ,
258- "connect_args" : {"connect_timeout" : 1 },
258+ "connect_args" : {"connect_timeout" : 1 , "application_name" : "dbos_transact" },
259259 }
260260 assert configFile ["database" ]["sys_db_engine_kwargs" ] == {
261261 "key" : "value" ,
262262 "pool_timeout" : 30 ,
263263 "max_overflow" : 0 ,
264264 "pool_size" : 27 ,
265265 "pool_pre_ping" : True ,
266- "connect_args" : {"connect_timeout" : 1 },
266+ "connect_args" : {"connect_timeout" : 1 , "application_name" : "dbos_transact" },
267267 }
268268
269269
@@ -397,14 +397,14 @@ def test_configure_db_engine_parameters_defaults():
397397 "max_overflow" : 0 ,
398398 "pool_size" : 20 ,
399399 "pool_pre_ping" : True ,
400- "connect_args" : {"connect_timeout" : 10 },
400+ "connect_args" : {"connect_timeout" : 10 , "application_name" : "dbos_transact" },
401401 }
402402 assert data ["sys_db_engine_kwargs" ] == {
403403 "pool_timeout" : 30 ,
404404 "max_overflow" : 0 ,
405405 "pool_size" : 20 ,
406406 "pool_pre_ping" : True ,
407- "connect_args" : {"connect_timeout" : 10 },
407+ "connect_args" : {"connect_timeout" : 10 , "application_name" : "dbos_transact" },
408408 }
409409
410410
@@ -419,14 +419,14 @@ def test_configure_db_engine_parameters_custom_sys_db_pool_sizes():
419419 "max_overflow" : 0 ,
420420 "pool_size" : 20 ,
421421 "pool_pre_ping" : True ,
422- "connect_args" : {"connect_timeout" : 10 },
422+ "connect_args" : {"connect_timeout" : 10 , "application_name" : "dbos_transact" },
423423 }
424424 assert data ["sys_db_engine_kwargs" ] == {
425425 "pool_timeout" : 30 ,
426426 "max_overflow" : 0 ,
427427 "pool_size" : 35 ,
428428 "pool_pre_ping" : True ,
429- "connect_args" : {"connect_timeout" : 10 },
429+ "connect_args" : {"connect_timeout" : 10 , "application_name" : "dbos_transact" },
430430 }
431431
432432
@@ -440,7 +440,11 @@ def test_configure_db_engine_parameters_user_kwargs_override():
440440 "pool_pre_ping" : True ,
441441 "custom_param" : "value" ,
442442 "pool_size" : 50 ,
443- "connect_args" : {"connect_timeout" : 30 , "key" : "value" },
443+ "connect_args" : {
444+ "connect_timeout" : 30 ,
445+ "key" : "value" ,
446+ "application_name" : "dbos_transact" ,
447+ },
444448 },
445449 }
446450
@@ -453,7 +457,11 @@ def test_configure_db_engine_parameters_user_kwargs_override():
453457 "pool_pre_ping" : True ,
454458 "custom_param" : "value" ,
455459 "pool_size" : 50 ,
456- "connect_args" : {"connect_timeout" : 30 , "key" : "value" },
460+ "connect_args" : {
461+ "connect_timeout" : 30 ,
462+ "key" : "value" ,
463+ "application_name" : "dbos_transact" ,
464+ },
457465 }
458466
459467 # System engine kwargs should use system pool size but same user overrides
@@ -463,7 +471,11 @@ def test_configure_db_engine_parameters_user_kwargs_override():
463471 "pool_pre_ping" : True ,
464472 "custom_param" : "value" ,
465473 "pool_size" : 35 ,
466- "connect_args" : {"connect_timeout" : 30 , "key" : "value" },
474+ "connect_args" : {
475+ "connect_timeout" : 30 ,
476+ "key" : "value" ,
477+ "application_name" : "dbos_transact" ,
478+ },
467479 }
468480
469481
@@ -487,7 +499,7 @@ def test_configure_db_engine_parameters_user_kwargs_and_db_url_connect_timeout()
487499 "pool_pre_ping" : True ,
488500 "custom_param" : "value" ,
489501 "pool_size" : 50 ,
490- "connect_args" : {"connect_timeout" : 22 },
502+ "connect_args" : {"connect_timeout" : 22 , "application_name" : "dbos_transact" },
491503 }
492504
493505 # System engine kwargs should use system pool size but same user overrides
@@ -497,7 +509,7 @@ def test_configure_db_engine_parameters_user_kwargs_and_db_url_connect_timeout()
497509 "pool_pre_ping" : True ,
498510 "custom_param" : "value" ,
499511 "pool_size" : 50 ,
500- "connect_args" : {"connect_timeout" : 22 },
512+ "connect_args" : {"connect_timeout" : 22 , "application_name" : "dbos_transact" },
501513 }
502514
503515
@@ -556,7 +568,7 @@ def test_configure_db_engine_parameters_user_kwargs_mixed_params():
556568 "pool_pre_ping" : True ,
557569 "custom_param" : "value" ,
558570 "pool_size" : 50 ,
559- "connect_args" : {"connect_timeout" : 10 },
571+ "connect_args" : {"connect_timeout" : 10 , "application_name" : "dbos_transact" },
560572 }
561573
562574 # System engine kwargs should use system pool size but same user overrides
@@ -566,7 +578,7 @@ def test_configure_db_engine_parameters_user_kwargs_mixed_params():
566578 "pool_pre_ping" : True ,
567579 "custom_param" : "value" ,
568580 "pool_size" : 50 ,
569- "connect_args" : {"connect_timeout" : 10 },
581+ "connect_args" : {"connect_timeout" : 10 , "application_name" : "dbos_transact" },
570582 }
571583
572584
@@ -581,14 +593,14 @@ def test_configure_db_engine_parameters_empty_user_kwargs():
581593 "max_overflow" : 0 ,
582594 "pool_size" : 20 ,
583595 "pool_pre_ping" : True ,
584- "connect_args" : {"connect_timeout" : 10 },
596+ "connect_args" : {"connect_timeout" : 10 , "application_name" : "dbos_transact" },
585597 }
586598 assert data ["sys_db_engine_kwargs" ] == {
587599 "pool_timeout" : 30 ,
588600 "max_overflow" : 0 ,
589601 "pool_size" : 20 ,
590602 "pool_pre_ping" : True ,
591- "connect_args" : {"connect_timeout" : 10 },
603+ "connect_args" : {"connect_timeout" : 10 , "application_name" : "dbos_transact" },
592604 }
593605
594606
0 commit comments