test: flaky TestCreate/creating_additional_advisory_for_package

Open
#975 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
go
Domain
testing-qa

Research direction

Start with create_test.go around line 221 and run TestCreate/creating_additional_advisory_for_package repeatedly, comparing the CI mismatch with local results. Trace how the advisory ID is produced and identify why the expected and actual documents differ. Done means the test reliably passes with deterministic advisory data.

Written by the indexing model from the issue text.

Description

bug needs-triage

Description

It seems there is a flaky test on the test suite of the advisories functions. I ran the test locally and it passed but I got an error on the CI here: https://github.com/wolfi-dev/wolfictl/actions/runs/9596890702/job/26464754752?pr=974#step:8:50.

TestCreate/creating_additional_advisory_for_package
    create_test.go:221: Update() mismatch (-want +got):
          v2.Document{
          	SchemaVersion: "2.0.2",
          	Package:       {Name: "brotli"},
          	Advisories: v2.Advisories{
        - 		{
        - 			ID:      "CGA-xoxo-xoxo-xoxo2",
        - 			Aliases: []string{"CVE-2023-1234"},
        - 			Events:  []v2.Event{{Timestamp: s"2022-09-26T00:00:00Z", Type: "detection", Data: v2.Detection{...}}},
        - 		},
          		{Aliases: {"CVE-2020-8927"}, Events: {{Timestamp: s"2022-09-15T02:40:18Z", Type: "fixed", Data: v2.Fixed{FixedVersion: "1.0.9-r0"}}}, ...},
        + 		{
        + 			ID:      "CGA-xr[44](https://github.com/wolfi-dev/wolfictl/actions/runs/9596890702/job/26464754752?pr=974#step:8:45)-c573-6rmw",
        + 			Aliases: []string{"CVE-2023-1234"},
        + 			Events:  []v2.Event{{Timestamp: s"2022-09-26T00:00:00Z", Type: "detection", Data: v2.Detection{...}}},
        + 		},
          	},
          }
Dominant language
Go
Stars
73
Forks
86
Avg merge
7d 7h
Merged PRs (30d)
15

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from wolfi-dev/wolfictl

All issues in wolfi-dev/wolfictl

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.