Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ func TestLineCardsNoHighCPUSpike(t *testing.T) {
}
}
if len(baseLCs) == 0 {
t.Errorf("ERROR: No Cisco linecard CPU base components found")
t.Skipf("Skip the test on No Cisco linecard CPU base components found.")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Use t.Fatalf instead of t.Skip when critical components like Cisco linecard CPUs are not found, as their absence should be considered a fatal test failure in health check tests. Additionally, ensure the message follows Go style: lowercase and no trailing punctuation.

Suggested change
t.Skipf("Skip the test on No Cisco linecard CPU base components found.")
t.Fatalf("no Cisco linecard CPU base components found")
References
  1. Go style guidelines specify that error and status messages should be lowercase and not end with punctuation. (link)
  2. When monitoring critical processes in a test, use t.Fatalf if a process is not found, as its absence should be considered a fatal test failure.
  3. In tests, t.Fatalf is preferred over t.Errorf when a failure makes subsequent test steps meaningless, as this fails fast and reduces overall test execution time.

}
// Skip non-removable linecards
var removable []string
Expand Down
Loading