-
Notifications
You must be signed in to change notification settings - Fork 438
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
[TEST] Add missing tests to Bazel build #3045
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
punya
force-pushed
the
missing-bazel-tests
branch
from
September 1, 2024 17:23
c076f6f
to
2134ebe
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3045 +/- ##
==========================================
+ Coverage 87.12% 87.66% +0.55%
==========================================
Files 200 190 -10
Lines 6109 5866 -243
==========================================
- Hits 5322 5142 -180
+ Misses 787 724 -63 |
punya
force-pushed
the
missing-bazel-tests
branch
2 times, most recently
from
September 1, 2024 17:41
0def936
to
6fbd858
Compare
punya
force-pushed
the
missing-bazel-tests
branch
2 times, most recently
from
September 1, 2024 19:45
dfc5a5c
to
48d6324
Compare
punya
force-pushed
the
missing-bazel-tests
branch
from
September 1, 2024 19:53
48d6324
to
1a5f10c
Compare
Also use steady clock consistently. Prior to this change, the test would fail under ASAN: bazel test --config=asan --test_output=errors //sdk/test/metrics:meter_provider_sdk_test INFO: Analyzed target //sdk/test/metrics:meter_provider_sdk_test (0 packages loaded, 0 targets configured). FAIL: //sdk/test/metrics:meter_provider_sdk_test (see /private/var/tmp/_bazel_punya/e3bd968ba61238cdeb1a5537fc3dbf7d/execroot/_main/bazel-out/darwin_arm64-fastbuild-asan/testlogs/sdk/test/metrics/meter_provider_sdk_test/test.log) INFO: From Testing //sdk/test/metrics:meter_provider_sdk_test: ==================== Test output for //sdk/test/metrics:meter_provider_sdk_test: Running main() from gmock_main.cc [==========] Running 1 test from 1 test suite. [----------] Global test environment set-up. [----------] 1 test from MeterProvider [ RUN ] MeterProvider.GetMeter [Warning] File: sdk/src/metrics/meter_provider.cc:65 [MeterProvider::GetMeter] Library name is empty. [Warning] File: sdk/src/metrics/meter_provider.cc:65 [MeterProvider::GetMeter] Library name is empty. /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__chrono/duration.h:102:59: runtime error: signed integer overflow: 9221646818050376183 * 1000 cannot be represented in type '_Ct' (aka 'long long') SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__chrono/duration.h:102:59 in ================================================================================ INFO: Found 1 test target... Target //sdk/test/metrics:meter_provider_sdk_test up-to-date: bazel-bin/sdk/test/metrics/meter_provider_sdk_test INFO: Elapsed time: 2.251s, Critical Path: 2.13s INFO: 5 processes: 5 darwin-sandbox. INFO: Build completed, 1 test FAILED, 5 total actions //sdk/test/metrics:meter_provider_sdk_test FAILED in 0.6s /private/var/tmp/_bazel_punya/e3bd968ba61238cdeb1a5537fc3dbf7d/execroot/_main/bazel-out/darwin_arm64-fastbuild-asan/testlogs/sdk/test/metrics/meter_provider_sdk_test/test.log Executed 1 out of 1 test: 1 fails locally. Fix overflow in periodic_exporting_metric_reader
Previously, we were missing * instrument_metadata_validator_test * observable_registry_test * cardinality_limit_test * periodic_exporting_metric_reader_test And there were no checks in place to prevent things from getting worse. Remove unnecessary exception checks in attributes_hashmap_test, which simplifies the build and CI script. Resolve symbol collision using anonymous namespaces.
punya
force-pushed
the
missing-bazel-tests
branch
from
September 1, 2024 21:42
1a5f10c
to
2bfc306
Compare
lalitb
approved these changes
Sep 3, 2024
marcalff
changed the title
Add missing tests to Bazel build
[TEST] Add missing tests to Bazel build
Sep 3, 2024
marcalff
approved these changes
Sep 3, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well spotted, and thanks for the fix.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
Previously, we were missing
And there were no checks in place to prevent things from getting worse.
In fact one of these, periodic_exporting_metric_reader_test, fails under ASAN - so we were masking a potential overflow bug.
This issue may exist elsewhere in the repo, so we may want to do a broader audit and/or invest in tooling to make it foolproof.