chore: 并入 iotlcm-worker-svr 历史到 worker-svr/(原提交 96f0f4e)

This commit is contained in:
MiFaZhan
2026-11-02 13:28:03 +08:00
422 changed files with 80993 additions and 0 deletions
@@ -0,0 +1,21 @@
package zset
import "testing"
// TestFailureFromOutcomeCarriesPackageCode guards the daily-usage replay path:
// the TDengine child table stores the package code and the diagnosis page reads
// it, so a failed card must survive into the failure pool with its package code
// intact, or the replayed write would wipe it to empty.
func TestFailureFromOutcomeCarriesPackageCode(t *testing.T) {
record := failureFromOutcome(
Task{TaskID: "r:op:42", RunID: "r", Operation: "op", QueryMonth: "20261009", ChanKey: "217", TempKey: "sim_yd_v5", CardID: 42, ICCID: "89860042", PackageCode: "PKG-A"},
TaskOutcome{Retryable: false, ErrorClass: "business", Code: 4242, Message: "boom"},
3,
)
if record.PackageCode != "PKG-A" {
t.Fatalf("failure record lost the package code: %+v", record)
}
if record.QueryMonth != "20261009" {
t.Fatalf("failure record lost the daily period: %+v", record)
}
}