fix(pcie): verify GPU links under real bandwidth load
This commit is contained in:
@@ -75,6 +75,46 @@ func TestApplySATResultToDBNormalizesGPUKeyByVendor(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestNvidiaBandwidthRetiresForcedRetrainWarning(t *testing.T) {
|
||||
db, err := OpenComponentStatusDB(filepath.Join(t.TempDir(), "component-status.json"))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
db.Record("pcie:gpu:nvidia", "sat:pcie-link", "Warning", "idle forced retrain stayed at Gen1")
|
||||
|
||||
ApplySATResultToDB(db, "nvidia-bandwidth", writeSATSummary(t, "OK"))
|
||||
|
||||
rec, ok := db.Get("pcie:gpu:nvidia")
|
||||
if !ok {
|
||||
t.Fatal("expected pcie:gpu:nvidia record")
|
||||
}
|
||||
if rec.Status != "OK" {
|
||||
t.Fatalf("status=%q want OK after real-traffic check supersedes forced retrain", rec.Status)
|
||||
}
|
||||
if lastEntryFromSource(rec.History, "sat:pcie-link") == nil {
|
||||
t.Fatal("retired forced-retrain observation must remain in audit history")
|
||||
}
|
||||
}
|
||||
|
||||
func TestNvidiaBandwidthDoesNotClearIndependentGPUWarning(t *testing.T) {
|
||||
db, err := OpenComponentStatusDB(filepath.Join(t.TempDir(), "component-status.json"))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
db.Record("pcie:gpu:nvidia", "sat:pcie-link", "Warning", "idle forced retrain stayed at Gen1")
|
||||
db.Record("pcie:gpu:nvidia", "sat:nvidia-config", "Warning", "NVLink error counters are non-zero")
|
||||
|
||||
ApplySATResultToDB(db, "nvidia-bandwidth", writeSATSummary(t, "OK"))
|
||||
|
||||
rec, ok := db.Get("pcie:gpu:nvidia")
|
||||
if !ok {
|
||||
t.Fatal("expected pcie:gpu:nvidia record")
|
||||
}
|
||||
if rec.Status != "Warning" || !strings.Contains(rec.ErrorSummary, "NVLink") {
|
||||
t.Fatalf("record=%+v want independent nvidia-config Warning to survive", rec)
|
||||
}
|
||||
}
|
||||
|
||||
func TestApplyComponentStatusDBMatchesGPUByVendor(t *testing.T) {
|
||||
db, err := OpenComponentStatusDB(filepath.Join(t.TempDir(), "component-status.json"))
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user