Skip to content

Commit e098cf2

Browse files
all: run lint tests in parallel
Also fix some spelling errors which were causing test failures. Change-Id: I4f4ad5d2cba805dcba8908f09653710e19ace4ea Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/728720 Reviewed-by: Ethan Lee <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent 36762fc commit e098cf2

File tree

6 files changed

+17
-15
lines changed

6 files changed

+17
-15
lines changed

all_test.go

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import (
1515
"runtime"
1616
"sort"
1717
"strings"
18+
"sync"
1819
"testing"
1920
"time"
2021

@@ -98,15 +99,17 @@ func TestLintReports(t *testing.T) {
9899
}
99100

100101
// Map from summaries to report paths, used to check for duplicate summaries.
101-
summaries := make(map[string]string)
102+
summaries := sync.Map{}
102103
sort.Strings(reports)
103104
for _, filename := range reports {
104105
t.Run(filename, func(t *testing.T) {
105-
r, err := report.Read(filename)
106+
cFilename := filename // capture variable so we can run tests in parallel safely
107+
t.Parallel()
108+
r, err := report.Read(cFilename)
106109
if err != nil {
107110
t.Fatal(err)
108111
}
109-
if err := r.CheckFilename(filename); err != nil {
112+
if err := r.CheckFilename(cFilename); err != nil {
110113
t.Error(err)
111114
}
112115
lints := lint(r)
@@ -122,15 +125,14 @@ func TestLintReports(t *testing.T) {
122125
}
123126
}
124127
for r2, aliases := range duplicates {
125-
t.Errorf("report %s shares duplicate alias(es) %s with report %s", filename, aliases, r2)
128+
t.Errorf("report %s shares duplicate alias(es) %s with report %s", cFilename, aliases, r2)
126129
}
127130
// Ensure that each reviewed report has a unique summary.
128131
if r.IsReviewed() {
129132
if summary := r.Summary.String(); summary != "" {
130-
if report, ok := summaries[summary]; ok {
131-
t.Errorf("report %s shares duplicate summary %q with report %s", filename, summary, report)
132-
} else {
133-
summaries[summary] = filename
133+
existingFile, loaded := summaries.LoadOrStore(summary, cFilename)
134+
if loaded {
135+
t.Errorf("report %s shares duplicate summary %q with report %s", cFilename, summary, existingFile)
134136
}
135137
}
136138
}
@@ -141,7 +143,7 @@ func TestLintReports(t *testing.T) {
141143
if r.IsUnreviewed() && !r.IsExcluded() && !r.UnreviewedOK {
142144
pr, _ := priority.AnalyzeReport(r, rc, modulesToImports)
143145
if pr.Priority == priority.High {
144-
t.Errorf("UNREVIEWED report %s is high priority (should be NEEDS_REVIEW or REVIEWED) - reason: %s", filename, pr.Reason)
146+
t.Errorf("UNREVIEWED report %s is high priority (should be NEEDS_REVIEW or REVIEWED) - reason: %s", cFilename, pr.Reason)
145147
}
146148
}
147149
// Check that a correct OSV file was generated for each YAML report.

data/cve/v5/GO-2025-4006.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"descriptions": [
1414
{
1515
"lang": "en",
16-
"value": "The ParseAddress function constructeds domain-literal address components through repeated string concatenation. When parsing large domain-literal components, this can cause excessive CPU consumption."
16+
"value": "The ParseAddress function constructs domain-literal address components through repeated string concatenation. When parsing large domain-literal components, this can cause excessive CPU consumption."
1717
}
1818
],
1919
"affected": [

data/osv/GO-2025-4006.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"CVE-2025-61725"
99
],
1010
"summary": "Excessive CPU consumption in ParseAddress in net/mail",
11-
"details": "The ParseAddress function constructeds domain-literal address components through repeated string concatenation. When parsing large domain-literal components, this can cause excessive CPU consumption.",
11+
"details": "The ParseAddress function constructs domain-literal address components through repeated string concatenation. When parsing large domain-literal components, this can cause excessive CPU consumption.",
1212
"affected": [
1313
{
1414
"package": {

data/osv/GO-2025-4177.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"CVE-2025-64750",
88
"GHSA-wwrx-w7c9-rf87"
99
],
10-
"summary": "Singluarity ineffectively applies of selinux / apparmor LSM process labels in github.com/sylabs/singularity",
11-
"details": "Singluarity ineffectively applies of selinux / apparmor LSM process labels in github.com/sylabs/singularity.\n\nNOTE: The source advisory for this report contains additional versions that could not be automatically mapped to standard Go module versions.\n\n(If this is causing false-positive reports from vulnerability scanners, please suggest an edit to the report.)\n\nThe additional affected modules and versions are: github.com/sylabs/singularity/v4 before v4.1.11.",
10+
"summary": "Singularity ineffectively applies of selinux / apparmor LSM process labels in github.com/sylabs/singularity",
11+
"details": "Singularity ineffectively applies of selinux / apparmor LSM process labels in github.com/sylabs/singularity.\n\nNOTE: The source advisory for this report contains additional versions that could not be automatically mapped to standard Go module versions.\n\n(If this is causing false-positive reports from vulnerability scanners, please suggest an edit to the report.)\n\nThe additional affected modules and versions are: github.com/sylabs/singularity/v4 before v4.1.11.",
1212
"affected": [
1313
{
1414
"package": {

data/reports/GO-2025-4006.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ modules:
1818
- ParseAddressList
1919
summary: Excessive CPU consumption in ParseAddress in net/mail
2020
description: |-
21-
The ParseAddress function constructeds domain-literal address components
21+
The ParseAddress function constructs domain-literal address components
2222
through repeated string concatenation. When parsing large domain-literal
2323
components, this can cause excessive CPU consumption.
2424
cves:

data/reports/GO-2025-4177.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ modules:
88
non_go_versions:
99
- fixed: 4.1.11
1010
vulnerable_at: 4.3.5
11-
summary: Singluarity ineffectively applies of selinux / apparmor LSM process labels in github.com/sylabs/singularity
11+
summary: Singularity ineffectively applies of selinux / apparmor LSM process labels in github.com/sylabs/singularity
1212
cves:
1313
- CVE-2025-64750
1414
ghsas:

0 commit comments

Comments
 (0)