Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: enforce race detector #2122

Merged
merged 1 commit into from
Sep 12, 2023
Merged

Conversation

willmurphyscode
Copy link
Contributor

Previously, there were some data races in syft. Right now, none are detected, so check for data races on the overall command, and on unit tests. (Checking for races on integration tests triples the time needed for those tests, from ~1 minute to ~3 minutes on my workstation, so that was not done at this time.)

Previously, there were some data races in syft. Right now, none are
detected, so check for data races on the overall command, and on unit
tests. (Checking for races on integration tests triples the time needed
for those tests, from ~1 minute to ~3 minutes on my workstation, so that
was not done at this time.)

Signed-off-by: Will Murphy <will.murphy@anchore.com>
@.github/scripts/coverage.py $(COVERAGE_THRESHOLD) $(TEMP_DIR)/unit-coverage-details.txt

.PHONY: integration
integration: ## Run integration tests
$(call title,Running integration tests)
go test -v ./test/integration
go run -race cmd/syft/main.go alpine:latest
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm open to using a different image, or maybe a test fixture here.

@github-actions
Copy link

Benchmark Test Results

Benchmark results from the latest changes vs base branch
goos: linux%0Agoarch: amd64%0Apkg: github.com/anchore/syft/test/integration%0Acpu: Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz%0A                                                              │ ./.tmp/benchmark-63feed9.txt │%0A                                                              │            sec/op            │%0AImagePackageCatalogers/alpmdb-cataloger-2                                       11.84m ±  1%25%0AImagePackageCatalogers/apkdb-cataloger-2                                        689.6µ ±  1%25%0AImagePackageCatalogers/binary-cataloger-2                                       206.5µ ± 20%25%0AImagePackageCatalogers/dpkgdb-cataloger-2                                       581.9µ ±  1%25%0AImagePackageCatalogers/dotnet-portable-executable-cataloger-2                   21.81µ ±  1%25%0AImagePackageCatalogers/go-module-binary-cataloger-2                             95.81µ ±  2%25%0AImagePackageCatalogers/java-cataloger-2                                         21.35m ±  1%25%0AImagePackageCatalogers/graalvm-native-image-cataloger-2                         92.76µ ±  1%25%0AImagePackageCatalogers/javascript-package-cataloger-2                           361.6µ ±  1%25%0AImagePackageCatalogers/nix-store-cataloger-2                                    273.5µ ±  1%25%0AImagePackageCatalogers/php-composer-installed-cataloger-2                       767.0µ ±  0%25%0AImagePackageCatalogers/portage-cataloger-2                                      471.8µ ±  2%25%0AImagePackageCatalogers/python-package-cataloger-2                               3.280m ±  2%25%0AImagePackageCatalogers/r-package-cataloger-2                                    197.0µ ±  1%25%0AImagePackageCatalogers/rpm-db-cataloger-2                                       536.1µ ±  1%25%0AImagePackageCatalogers/ruby-gemspec-cataloger-2                                 890.5µ ±  1%25%0AImagePackageCatalogers/sbom-cataloger-2                                         118.1µ ±  0%25%0Ageomean                                                                         489.3µ%0A%0A                                                              │ ./.tmp/benchmark-63feed9.txt │%0A                                                              │             B/op             │%0AImagePackageCatalogers/alpmdb-cataloger-2                                       5.064Mi ± 0%25%0AImagePackageCatalogers/apkdb-cataloger-2                                        181.6Ki ± 0%25%0AImagePackageCatalogers/binary-cataloger-2                                       30.76Ki ± 0%25%0AImagePackageCatalogers/dpkgdb-cataloger-2                                       139.7Ki ± 0%25%0AImagePackageCatalogers/dotnet-portable-executable-cataloger-2                   3.695Ki ± 0%25%0AImagePackageCatalogers/go-module-binary-cataloger-2                             9.281Ki ± 0%25%0AImagePackageCatalogers/java-cataloger-2                                         3.315Mi ± 0%25%0AImagePackageCatalogers/graalvm-native-image-cataloger-2                         8.000Ki ± 0%25%0AImagePackageCatalogers/javascript-package-cataloger-2                           82.87Ki ± 0%25%0AImagePackageCatalogers/nix-store-cataloger-2                                    38.38Ki ± 0%25%0AImagePackageCatalogers/php-composer-installed-cataloger-2                       152.6Ki ± 0%25%0AImagePackageCatalogers/portage-cataloger-2                                      108.3Ki ± 0%25%0AImagePackageCatalogers/python-package-cataloger-2                               982.5Ki ± 0%25%0AImagePackageCatalogers/r-package-cataloger-2                                    42.37Ki ± 0%25%0AImagePackageCatalogers/rpm-db-cataloger-2                                       165.4Ki ± 0%25%0AImagePackageCatalogers/ruby-gemspec-cataloger-2                                 122.4Ki ± 0%25%0AImagePackageCatalogers/sbom-cataloger-2                                         14.20Ki ± 0%25%0Ageomean                                                                         91.89Ki%0A%0A                                                              │ ./.tmp/benchmark-63feed9.txt │%0A                                                              │          allocs/op           │%0AImagePackageCatalogers/alpmdb-cataloger-2                                        74.98k ± 0%25%0AImagePackageCatalogers/apkdb-cataloger-2                                         3.670k ± 0%25%0AImagePackageCatalogers/binary-cataloger-2                                         866.0 ± 0%25%0AImagePackageCatalogers/dpkgdb-cataloger-2                                        2.721k ± 0%25%0AImagePackageCatalogers/dotnet-portable-executable-cataloger-2                     132.0 ± 0%25%0AImagePackageCatalogers/go-module-binary-cataloger-2                               270.0 ± 0%25%0AImagePackageCatalogers/java-cataloger-2                                          43.41k ± 0%25%0AImagePackageCatalogers/graalvm-native-image-cataloger-2                           218.0 ± 0%25%0AImagePackageCatalogers/javascript-package-cataloger-2                            1.203k ± 0%25%0AImagePackageCatalogers/nix-store-cataloger-2                                      751.0 ± 0%25%0AImagePackageCatalogers/php-composer-installed-cataloger-2                        3.461k ± 0%25%0AImagePackageCatalogers/portage-cataloger-2                                       2.011k ± 0%25%0AImagePackageCatalogers/python-package-cataloger-2                                15.76k ± 0%25%0AImagePackageCatalogers/r-package-cataloger-2                                      782.0 ± 0%25%0AImagePackageCatalogers/rpm-db-cataloger-2                                        2.877k ± 0%25%0AImagePackageCatalogers/ruby-gemspec-cataloger-2                                  2.185k ± 0%25%0AImagePackageCatalogers/sbom-cataloger-2                                           394.0 ± 0%25%0Ageomean                                                                          1.870k

@willmurphyscode willmurphyscode merged commit 9de4129 into main Sep 12, 2023
9 checks passed
@willmurphyscode willmurphyscode deleted the chore-enforce-race-detector branch September 12, 2023 17:09
GijsCalis pushed a commit to GijsCalis/syft that referenced this pull request Feb 19, 2024
Previously, there were some data races in syft. Right now, none are
detected, so check for data races on the overall command, and on unit
tests. (Checking for races on integration tests triples the time needed
for those tests, from ~1 minute to ~3 minutes on my workstation, so that
was not done at this time.)

Signed-off-by: Will Murphy <will.murphy@anchore.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants