Skip to content

Commit

Permalink
fix: flaky test (#1277)
Browse files Browse the repository at this point in the history
  • Loading branch information
worstell authored Apr 16, 2024
1 parent e6ddabe commit 22b6e84
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions buildengine/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,23 +67,23 @@ func assertBuildProtoErrors(msgs ...string) assertion {
errorList, err := loadProtoErrors(filepath.Join(bctx.moduleDir, bctx.buildDir))
assert.NoError(t, err, "Error loading proto errors")

expected := make([]*schema.Error, 0, len(msgs))
expected := make([]error, 0, len(msgs))
for _, msg := range msgs {
expected = append(expected, &schema.Error{Msg: msg})
}

// normalize results
errs := make([]error, 0, len(errorList.Errors))
for _, e := range errorList.Errors {
errs = append(errs, *e)
e.EndColumn = 0
}
schema.SortErrorsByPosition(errs)

errs := make([]error, 0, len(errorList.Errors))
for _, e := range errorList.Errors {
e.EndColumn = 0
errs = append(errs, e)
}
schema.SortErrorsByPosition(errs)

assert.Equal(t, errorList.Errors, expected, assert.Exclude[schema.Position]())
assert.Equal(t, errs, expected, assert.Exclude[schema.Position]())
return nil
}
}

0 comments on commit 22b6e84

Please sign in to comment.