test(infra): 缩短测试库连接超时 30s→2s 并加入 MSTest 并行 .runsettings
UnitTestProject/appsettings.json: 四个连接串 Connection Timeout=30→2,无库环境连不上 2 秒即失败,避免逐个 DB 测试 30s 空转;有库时 LAN 连接<1s 不受影响。新增 .runsettings: Workers=0(自动取 CPU 核数)+Scope=TestClass 类级并行,opt-in(仅 --settings 生效);共享静态单例(LogFactory/DataCacheManager/YLServiceLocator)启用前先跑串行基线确认无交叉污染。
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
MSTest 并行化配置(opt-in:仅在 `dotnet test --settings .runsettings` 时生效)。
|
||||
Workers=0 自动取 CPU 核数;Scope=TestClass 比 Method 安全(同类内静态单例不互踩)。
|
||||
注意:本仓库测试共享静态状态(LogFactory / DataCacheManager / YLServiceLocator 单例,见 UnitTestProject/Program.cs M1)。
|
||||
启用前务必先跑一次串行基线,确认无交叉污染后再作为默认。
|
||||
-->
|
||||
<RunSettings>
|
||||
<MSTest>
|
||||
<Parallelize>
|
||||
<Workers>0</Workers>
|
||||
<Scope>TestClass</Scope>
|
||||
</Parallelize>
|
||||
</MSTest>
|
||||
</RunSettings>
|
||||
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"ConnectionStrings": {
|
||||
"ylcms": "server=192.168.2.96;uid=DBAdmin;pooling=true;port=3306;pwd=YieldChain$$2025;database=glms_yltrs_ylcms;charset=utf8;Allow User Variables=True;SslMode=none;Connection Timeout=30;IgnoreCommandTransaction=true;",
|
||||
"yladmin": "server=192.168.2.96;uid=DBAdmin;pooling=true;port=3306;pwd=YieldChain$$2025;database=glms_yltrs_admin;charset=utf8;Allow User Variables=True;SslMode=none;Connection Timeout=30;IgnoreCommandTransaction=true;",
|
||||
"ylclient": "server=192.168.2.96;uid=DBAdmin;pooling=true;port=3306;pwd=YieldChain$$2025;database=glms_yltrs_client;charset=utf8;Allow User Variables=True;SslMode=none;Connection Timeout=30;IgnoreCommandTransaction=true;",
|
||||
"bondoms": "server=192.168.2.96;uid=DBAdmin;pooling=true;port=3306;pwd=YieldChain$$2025;database=zszq_bond_oms;charset=utf8;Allow User Variables=True;SslMode=none;Connection Timeout=30;IgnoreCommandTransaction=true;"
|
||||
"ylcms": "server=192.168.2.96;uid=DBAdmin;pooling=true;port=3306;pwd=YieldChain$$2025;database=glms_yltrs_ylcms;charset=utf8;Allow User Variables=True;SslMode=none;Connection Timeout=2;IgnoreCommandTransaction=true;",
|
||||
"yladmin": "server=192.168.2.96;uid=DBAdmin;pooling=true;port=3306;pwd=YieldChain$$2025;database=glms_yltrs_admin;charset=utf8;Allow User Variables=True;SslMode=none;Connection Timeout=2;IgnoreCommandTransaction=true;",
|
||||
"ylclient": "server=192.168.2.96;uid=DBAdmin;pooling=true;port=3306;pwd=YieldChain$$2025;database=glms_yltrs_client;charset=utf8;Allow User Variables=True;SslMode=none;Connection Timeout=2;IgnoreCommandTransaction=true;",
|
||||
"bondoms": "server=192.168.2.96;uid=DBAdmin;pooling=true;port=3306;pwd=YieldChain$$2025;database=zszq_bond_oms;charset=utf8;Allow User Variables=True;SslMode=none;Connection Timeout=2;IgnoreCommandTransaction=true;"
|
||||
},
|
||||
"LibreOffice": {
|
||||
"ExePath": "",
|
||||
|
||||
Reference in New Issue
Block a user