Skip to content

Make test-go.yaml CI check fail when cron jobs panic+recover #21292

@lucasmrod

Description

@lucasmrod

Goal

User story
As a developer,
I want to know when Fleet cron jobs are panicking on CI
so that I can bugs in development/testing instead of in production.

Currently this is not the case because Fleet executes a recover on panic in cron jobs (which we want to keep as is) and CI is not parsing the output to detect this:

c1grep -A 10 'panic: runtime error: ' /tmp/gotest.log >> /tmp/summary.txt

if r := recover(); r != nil {

Sample of a green CI run with a "hidden" panic:
https://github.com/fleetdm/fleet/actions/runs/10313407643/job/28550120568
which has the following log in Fleet's cron logger output:

{
  "cron": "vulnerabilities",
  "details": "runtime error: invalid memory address or nil pointer dereference",
  "err": "running job",
  "instanceID": "test_instance",
  "jobID": "cron_vulnerabilities",
  "level": "error",
  "schedule": "vulnerabilities"
}

Metadata

Metadata

Assignees

Labels

#g-endpoint-opsEndpoint ops product group:releaseReady to write code. Scheduled in a release. See "Making changes" in handbook.P2Urgent: Supported workflow not functioning as intended, newly drafted feature with urgent Fleet needstoryA user story defining an entire feature~eng-priorityEngineering-initiated story that was prioritized.~engineering-initiatedEngineering-initiated story, such as a bug, refactor, or contributor experience improvement.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions