Sparkdo.Scheduler.Testing 3.0.0-preview.1

This is a prerelease version of Sparkdo.Scheduler.Testing.
dotnet add package Sparkdo.Scheduler.Testing --version 3.0.0-preview.1
                    
NuGet\Install-Package Sparkdo.Scheduler.Testing -Version 3.0.0-preview.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Sparkdo.Scheduler.Testing" Version="3.0.0-preview.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Sparkdo.Scheduler.Testing" Version="3.0.0-preview.1" />
                    
Directory.Packages.props
<PackageReference Include="Sparkdo.Scheduler.Testing" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Sparkdo.Scheduler.Testing --version 3.0.0-preview.1
                    
#r "nuget: Sparkdo.Scheduler.Testing, 3.0.0-preview.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Sparkdo.Scheduler.Testing@3.0.0-preview.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Sparkdo.Scheduler.Testing&version=3.0.0-preview.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Sparkdo.Scheduler.Testing&version=3.0.0-preview.1&prerelease
                    
Install as a Cake Tool

Sparkdo.Scheduler.Testing

Sparkdo.Scheduler.Testing 是 Scheduler 的 test-only package。当前包含 SchedulerTestingKit、ManualTimeProvider(BCL TimeProvider 的可编程实现)、manual trigger runner、history assertions、local simulation、provider conformance cases、 worker-required provider behavior cases、provider certification evidence、store schema migration conformance proof types 和 fault injection profile,用于组合 in-memory runtime proof 并为后续 provider conformance harness 做准备。

History conformance 已覆盖 event order 和 bounded retention cleanup;worker-required cases 覆盖 executor registration/heartbeat、draining claim block、stale lease recovery、trigger occurrence uniqueness、claim placement fail-closed、bounded cleanup 和 diagnostics watermark evidence;multi-node cases(IMultiNodeConformanceCase + RunMultiNodeAsync,共享存储的多 kit 多客户端模拟)覆盖并发 claim 原子性、跨节点 stale lease fencing 接管与双写幂等入队,是 StoreFeatures.DistributedClaim 的唯一 行为证据来源——自报该 feature 不能替代;store-clock 场景是 StoreFeatures.StoreClock 的行为证据来源; management cases 覆盖队列暂停的跨客户端效力、强制取消的跨客户端效力与命令幂等 (同键同内容重放返回同一 envelope、同键异内容 Conflict)、死信重驱的跨节点可见性 与 trace 延续;ProviderConformanceReport.Combine 把单 kit 运行与多节点运行的证据合并重新评估认证。store schema migration conformance 类型只属于 Testing,不进入 Sparkdo.Scheduler.Abstractions,并且只证明缺少 persistent evidence 时 fail closed,不执行 provider migration;local simulation 只输出低敏 replay evidence,不是生产恢复协议;默认 in-memory proof 只能得到 SingleProcess certification,不能被描述为 persistent / multi-node provider。

Multi-node case 的能力协商是宿主契约:用例声明 NodeCount 与 RequiredClusterFeatures,RunMultiNodeAsync 把声明原样交给宿主 cluster factory, factory 必须据此切换集群模式(EF 切 LeaseClock=Store;in-memory 集群注入 store 时钟),声明 StoreFeatures.StoreClock 时提供的 store 时钟必须会前进。 store-clock 场景由负向段(偏斜调用方时钟偷不走 store 时钟下仍存活的租约)与正向段 (store 时钟下真正过期的租约必须被回收、旧围栏被拒、回收后可完成)共同构成,正向段是 StoreFeatures.StoreClock 证据的必要部分——只有负向断言的 provider 拿不到该证据, 回收路径在 Store 模式下整体失效的 provider 因此不可能认证到 MultiNodePersistent。 宿主满足不了声明的能力时该用例跳过:ConformanceResult.Outcome 为 ConformanceOutcome.Skipped(唯一事实来源,Passed 因此为 false)、ProvenFeatures 为空、 不进 ProviderCertificationEvidence.PassedCaseIds,并在降级原因里留下 skipped-conformance-case:<caseId>;ProviderConformanceReport.SkippedCaseIds 列出本轮全部 跳过用例,ProviderConformanceReport.Passed 只在全部用例真跑且通过时为 true(任一跳过或 失败即 false),所以"环境缺能力"与"真的通过"在出证报告里可区分(跳过既不算失败也不算通过); 单个用例抛出的异常被收敛为 <caseId>-threw:<异常类型>:<消息> 的失败结果,不中断整轮 出证。迁移预检只报告 provider 端口的实测事实(身份、能力、水印、可读历史行数),自报 能力不构成证据。

本包不进入 Sparkdo.Scheduler runtime 依赖图,也不作为生产默认依赖传递。

组成

类型组 内容
时钟 ManualTimeProvider,确定性推进/设置当前时间,用于 runtime tests。
Runners ManualTriggerRunner,显式执行单轮 schedule scan;SchedulerTestingKit.RunPendingAsync(CreateForJob kit 装配的 ExecutionRunner),claim 并执行一条待执行 execution。
Kit SchedulerTestingKit.CreateForJob<TJob>:直接从 [Job] 注解类型创建 kit——descriptor、invoker、activator 取自 generated contribution,payload 走 in-memory 引用路径,Runner 用传入的 IServiceProvider 激活 job 构造依赖;找不到注解 descriptor 时抛出带已注册 job 清单的异常。
Assertions history / result assertion helpers;HistoryAssertions.WaitUntilAsync 提供计数/谓词等待。
Conformance provider conformance report、certification evidence、result、runner,以及 execution queue、schedule store、executor store、worker-required provider behavior、history event order、history retention cleanup、store feature cases、multi-node distributed-claim cases、store schema migration fail-closed case。runner 逐用例隔离异常(<caseId>-threw:* 失败结果),宿主能力不足的用例记为 ConformanceOutcome.Skipped(既不计入通过、也无证据 + skipped-conformance-case:* 降级原因)。
Fault injection FaultInjectionKind 和 FaultInjectionProfile,只描述测试 hook,不改变生产 runtime。
Infrastructure SchedulerTestingKit 和 testing-only contribution provider。
Simulation LocalSimulation、script、step、event 和 result,用 deterministic clock 与公开 Scheduler/store seam 生成低敏 replay evidence。

后续 conformance、fault injection 和测试辅助必须继续一类型一文件;新增 case 不要 合并到既有文件里。

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed.  net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.0-preview.1 60 10/30/2026
2.0.0-preview.2 98 7/20/2026
2.0.0-preview.1 98 7/18/2026