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

metrics_aggregator_test is flaky #2302

Closed
vaind opened this issue Sep 19, 2024 · 3 comments
Closed

metrics_aggregator_test is flaky #2302

vaind opened this issue Sep 19, 2024 · 3 comments

Comments

@vaind
Copy link
Collaborator

vaind commented Sep 19, 2024

Description

I see this fail from time to time

❌ test/metrics/metrics_aggregator_test.dart: emit in same time bucket same metric with different tags emit different metrics (failed)
  Expected: <2>
    Actual: <1>
  
  package:matcher                                  expect
  test/metrics/metrics_aggregator_test.dart 189:7  main.<fn>.<fn>
@vaind
Copy link
Collaborator Author

vaind commented Sep 20, 2024

Also some more in https://github.com/getsentry/sentry-dart/actions/runs/10942003756/job/30377979535

❌ test/metrics/metrics_aggregator_test.dart: span local aggregation emit calls add (failed after test completion)
❌ test/metrics/metrics_aggregator_test.dart: span local aggregation emit calls add (failed after test completion)
❌ test/metrics/metrics_aggregator_test.dart: span local aggregation emit set (failed after test completion)
❌ test/metrics/metrics_aggregator_test.dart: span local aggregation emit set (failed after test completion)
❌ test/metrics/metrics_aggregator_test.dart: span local aggregation emit counter (failed after test completion)
❌ test/metrics/metrics_aggregator_test.dart: span local aggregation emit counter (failed after test completion)
❌ test/metrics/metrics_aggregator_test.dart: span local aggregation emit gauge (failed after test completion)
❌ test/metrics/metrics_aggregator_test.dart: span local aggregation emit gauge (failed after test completion)
❌ test/metrics/metrics_aggregator_test.dart: span local aggregation emit distribution (failed after test completion)
❌ test/metrics/metrics_aggregator_test.dart: span local aggregation emit distribution (failed after test completion)

a sample stack trace:

ClientException: XMLHttpRequest error., uri=https://sentry.example.com/api/1/envelope/
  org-dartlang-sdk:///lib/_internal/js_runtime/lib/core_patch.dart 835:36   Object.StackTrace.current
  package:http/src/browser_client.dart 98:22                                BrowserClient.send.<fn>
  package:stack_trace                                                       StackZoneSpecification._run
  org-dartlang-sdk:///lib/async/zone.dart 1407:46                           StaticClosure._rootRunUnary
  org-dartlang-sdk:///lib/async/zone.dart 1307:34                           _CustomZone.runUnary
  org-dartlang-sdk:///lib/async/future_impl.dart 127:29                     _Future._propagateToListeners.handleValueCallback
  org-dartlang-sdk:///lib/async/future_impl.dart 875:13                     Object._Future._propagateToListeners
  org-dartlang-sdk:///lib/async/future_impl.dart 638:7                      _Future._complete
  ===== asynchronous gap ===========================
  org-dartlang-sdk:///lib/async/zone.dart 596:30                            _AsyncCompleter.completeError
  package:http/src/browser_client.dart 96:7                                 BrowserClient.send.<fn>
  ===== asynchronous gap ===========================
  org-dartlang-sdk:///lib/async/zone.dart 1328:34                           _CustomZone.registerUnaryCallback
  org-dartlang-sdk:///lib/async/future_impl.dart 331:11                     _Future.then
  org-dartlang-sdk:///lib/async/future_impl.dart 318:13                     _Future.then
  package:http/src/browser_client.dart 93:33                                <fn>
  org-dartlang-sdk:///lib/_internal/js_runtime/lib/async_patch.dart 307:19  _wrapJsFunctionForAsync.closure.$protected
  org-dartlang-sdk:///lib/_internal/js_runtime/lib/async_patch.dart 332:23  _wrapJsFunctionForAsync.<fn>
  ===== asynchronous gap ===========================
  org-dartlang-sdk:///lib/async/zone.dart 1336:34                           _CustomZone.registerBinaryCallback
  org-dartlang-sdk:///lib/async/zone.dart 596:30                            Object._wrapJsFunctionForAsync
  package:sentry/src/transport/http_transport.dart 47:37                    <fn>
  org-dartlang-sdk:///lib/_internal/js_runtime/lib/async_patch.dart 307:19  _wrapJsFunctionForAsync.closure.$protected
  org-dartlang-sdk:///lib/_internal/js_runtime/lib/async_patch.dart 332:23  _wrapJsFunctionForAsync.<fn>
  ===== asynchronous gap ===========================
  org-dartlang-sdk:///lib/async/zone.dart 1336:34                           _CustomZone.registerBinaryCallback
  org-dartlang-sdk:///lib/async/zone.dart 596:30                            Object._wrapJsFunctionForAsync
  package:sentry/src/sentry_client.dart 596:22                              SentryClient._attachClientReportsAndSend.<fn>
  package:sentry/src/transport/task_queue.dart 23:22                        <fn>
  org-dartlang-sdk:///lib/_internal/js_runtime/lib/async_patch.dart 307:19  _wrapJsFunctionForAsync.closure.$protected
  ===== asynchronous gap ===========================
  org-dartlang-sdk:///lib/async/zone.dart 1336:34                           _CustomZone.registerBinaryCallback
  org-dartlang-sdk:///lib/async/zone.dart 596:30                            Object._wrapJsFunctionForAsync
  package:sentry/src/transport/task_queue.dart 16:5                         TaskQueue.enqueue
  package:sentry/src/sentry_client.dart 595:12                              SentryClient._attachClientReportsAndSend
  package:sentry/src/sentry_client.dart 447:22                              <fn>
  ===== asynchronous gap ===========================
  org-dartlang-sdk:///lib/async/zone.dart 1336:34                           _CustomZone.registerBinaryCallback
  org-dartlang-sdk:///lib/async/zone.dart 596:30                            Object._wrapJsFunctionForAsync
  package:sentry/src/sentry_client.dart 442:11                              SentryClient.captureMetrics
  package:sentry/src/hub.dart 615:31                                        <fn>
  org-dartlang-sdk:///lib/_internal/js_runtime/lib/async_patch.dart 307:19  _wrapJsFunctionForAsync.closure.$protected
  ===== asynchronous gap ===========================
  org-dartlang-sdk:///lib/async/zone.dart 1336:34                           _CustomZone.registerBinaryCallback
  org-dartlang-sdk:///lib/async/zone.dart 596:30                            Object._wrapJsFunctionForAsync
  package:sentry/src/hub.dart 595:9                                         Hub.captureMetrics
  package:sentry/src/metrics/metrics_aggregator.dart 161:13                 <fn>
  org-dartlang-sdk:///lib/_internal/js_runtime/lib/async_patch.dart 307:19  _wrapJsFunctionForAsync.closure.$protected
  ===== asynchronous gap ===========================
  org-dartlang-sdk:///lib/async/zone.dart 1336:34                           _CustomZone.registerBinaryCallback
  org-dartlang-sdk:///lib/async/zone.dart 596:30                            Object._wrapJsFunctionForAsync
  package:sentry/src/metrics/metrics_aggregator.dart 125:51                 MetricsAggregator._scheduleFlush.<fn>
  ===== asynchronous gap ===========================
  org-dartlang-sdk:///lib/async/zone.dart 1321:34                           _CustomZone.registerCallback
  org-dartlang-sdk:///lib/async/zone.dart 1248:22                           _CustomZone.bindCallbackGuarded
  org-dartlang-sdk:///lib/async/timer.dart 55:37                            Object.Timer.Timer
  package:sentry/src/metrics/metrics_aggregator.dart 125:9                  MetricsAggregator._scheduleFlush
  package:sentry/src/metrics/metrics_aggregator.dart 169:5                  <fn>
  org-dartlang-sdk:///lib/_internal/js_runtime/lib/async_patch.dart 307:19  _wrapJsFunctionForAsync.closure.$protected
  ===== asynchronous gap ===========================
  org-dartlang-sdk:///lib/async/zone.dart 1336:34                           _CustomZone.registerBinaryCallback
  org-dartlang-sdk:///lib/async/zone.dart 596:30                            Object._wrapJsFunctionForAsync
  package:sentry/src/metrics/metrics_aggregator.dart 125:51                 MetricsAggregator._scheduleFlush.<fn>
  ===== asynchronous gap ===========================
  org-dartlang-sdk:///lib/async/zone.dart 1321:34                           _CustomZone.registerCallback
  org-dartlang-sdk:///lib/async/zone.dart 1248:22                           _CustomZone.bindCallbackGuarded
  org-dartlang-sdk:///lib/async/timer.dart 55:37                            Object.Timer.Timer
  package:sentry/src/metrics/metrics_aggregator.dart 125:9                  MetricsAggregator._scheduleFlush
  package:sentry/src/metrics/metrics_aggregator.dart 169:5                  <fn>
  org-dartlang-sdk:///lib/_internal/js_runtime/lib/async_patch.dart 307:19  _wrapJsFunctionForAsync.closure.$protected
  ===== asynchronous gap ===========================
  org-dartlang-sdk:///lib/async/zone.dart 1336:34                           _CustomZone.registerBinaryCallback
  org-dartlang-sdk:///lib/async/zone.dart 596:30                            Object._wrapJsFunctionForAsync
  package:sentry/src/metrics/metrics_aggregator.dart 125:51                 MetricsAggregator._scheduleFlush.<fn>
  ===== asynchronous gap ===========================
  org-dartlang-sdk:///lib/async/zone.dart 1321:34                           _CustomZone.registerCallback
  org-dartlang-sdk:///lib/async/zone.dart 1248:22                           _CustomZone.bindCallbackGuarded
  org-dartlang-sdk:///lib/async/timer.dart 55:37                            Object.Timer.Timer
  package:sentry/src/metrics/metrics_aggregator.dart 125:9                  MetricsAggregator._scheduleFlush
  package:sentry/src/metrics/metrics_aggregator.dart 169:5                  <fn>
  org-dartlang-sdk:///lib/_internal/js_runtime/lib/async_patch.dart 307:19  _wrapJsFunctionForAsync.closure.$protected
  ===== asynchronous gap ===========================
  org-dartlang-sdk:///lib/async/zone.dart 1336:34                           _CustomZone.registerBinaryCallback
  org-dartlang-sdk:///lib/async/zone.dart 596:30                            Object._wrapJsFunctionForAsync
  package:sentry/src/metrics/metrics_aggregator.dart 125:51                 MetricsAggregator._scheduleFlush.<fn>
  ===== asynchronous gap ===========================
  org-dartlang-sdk:///lib/async/zone.dart 1321:34                           _CustomZone.registerCallback
  org-dartlang-sdk:///lib/async/zone.dart 1248:22                           _CustomZone.bindCallbackGuarded
  org-dartlang-sdk:///lib/async/timer.dart 55:37                            Object.Timer.Timer
  package:sentry/src/metrics/metrics_aggregator.dart 125:9                  MetricsAggregator._scheduleFlush
  package:sentry/src/metrics/metrics_aggregator.dart 169:5                  <fn>
  org-dartlang-sdk:///lib/_internal/js_runtime/lib/async_patch.dart 307:19  _wrapJsFunctionForAsync.closure.$protected
  ===== asynchronous gap ===========================
  org-dartlang-sdk:///lib/async/zone.dart 1336:34                           _CustomZone.registerBinaryCallback
  org-dartlang-sdk:///lib/async/zone.dart 596:30                            Object._wrapJsFunctionForAsync
  package:sentry/src/metrics/metrics_aggregator.dart 125:51                 MetricsAggregator._scheduleFlush.<fn>
  ===== asynchronous gap ===========================
  org-dartlang-sdk:///lib/async/zone.dart 1321:34                           _CustomZone.registerCallback
  org-dartlang-sdk:///lib/async/zone.dart 1248:22                           _CustomZone.bindCallbackGuarded
  org-dartlang-sdk:///lib/async/timer.dart 55:37                            Object.Timer.Timer
  package:sentry/src/metrics/metrics_aggregator.dart 125:9                  MetricsAggregator._scheduleFlush
  package:sentry/src/metrics/metrics_aggregator.dart 169:5                  <fn>
  org-dartlang-sdk:///lib/_internal/js_runtime/lib/async_patch.dart 307:19  _wrapJsFunctionForAsync.closure.$protected
  ===== asynchronous gap ===========================
  org-dartlang-sdk:///lib/async/zone.dart 1336:34                           _CustomZone.registerBinaryCallback
  org-dartlang-sdk:///lib/async/zone.dart 596:30                            Object._wrapJsFunctionForAsync
  package:sentry/src/metrics/metrics_aggregator.dart 125:51                 MetricsAggregator._scheduleFlush.<fn>
  ===== asynchronous gap ===========================
  org-dartlang-sdk:///lib/async/zone.dart 1321:34                           _CustomZone.registerCallback
  org-dartlang-sdk:///lib/async/zone.dart 1248:22                           _CustomZone.bindCallbackGuarded
  org-dartlang-sdk:///lib/async/timer.dart 55:37                            Object.Timer.Timer
  package:sentry/src/metrics/metrics_aggregator.dart 125:9                  MetricsAggregator._scheduleFlush
  package:sentry/src/metrics/metrics_aggregator.dart 169:5                  <fn>
  org-dartlang-sdk:///lib/_internal/js_runtime/lib/async_patch.dart 307:19  _wrapJsFunctionForAsync.closure.$protected
  ===== asynchronous gap ===========================
  org-dartlang-sdk:///lib/async/zone.dart 1336:34                           _CustomZone.registerBinaryCallback
  org-dartlang-sdk:///lib/async/zone.dart 596:30                            Object._wrapJsFunctionForAsync
  package:sentry/src/metrics/metrics_aggregator.dart 125:51                 MetricsAggregator._scheduleFlush.<fn>
  ===== asynchronous gap ===========================
  org-dartlang-sdk:///lib/async/zone.dart 1321:34                           _CustomZone.registerCallback
  org-dartlang-sdk:///lib/async/zone.dart 1248:22                           _CustomZone.bindCallbackGuarded
  org-dartlang-sdk:///lib/async/timer.dart 55:37                            Object.Timer.Timer
  package:sentry/src/metrics/metrics_aggregator.dart 125:9                  MetricsAggregator._scheduleFlush
  package:sentry/src/metrics/metrics_aggregator.dart 169:5                  <fn>
  org-dartlang-sdk:///lib/_internal/js_runtime/lib/async_patch.dart 307:19  _wrapJsFunctionForAsync.closure.$protected
  ===== asynchronous gap ===========================
  org-dartlang-sdk:///lib/async/zone.dart 1336:34                           _CustomZone.registerBinaryCallback
  org-dartlang-sdk:///lib/async/zone.dart 596:30                            Object._wrapJsFunctionForAsync
  package:sentry/src/metrics/metrics_aggregator.dart 125:51                 MetricsAggregator._scheduleFlush.<fn>
  ===== asynchronous gap ===========================
  org-dartlang-sdk:///lib/async/zone.dart 1321:34                           _CustomZone.registerCallback
  org-dartlang-sdk:///lib/async/zone.dart 1248:22                           _CustomZone.bindCallbackGuarded
  org-dartlang-sdk:///lib/async/timer.dart 55:37                            Object.Timer.Timer
  package:sentry/src/metrics/metrics_aggregator.dart 125:9                  MetricsAggregator._scheduleFlush
  package:sentry/src/metrics/metrics_aggregator.dart 169:5                  <fn>
  org-dartlang-sdk:///lib/_internal/js_runtime/lib/async_patch.dart 307:19  _wrapJsFunctionForAsync.closure.$protected
  ===== asynchronous gap ===========================
  org-dartlang-sdk:///lib/async/zone.dart 1336:34                           _CustomZone.registerBinaryCallback
  org-dartlang-sdk:///lib/async/zone.dart 596:30                            Object._wrapJsFunctionForAsync
  package:sentry/src/metrics/metrics_aggregator.dart 125:51                 MetricsAggregator._scheduleFlush.<fn>
  ===== asynchronous gap ===========================
  org-dartlang-sdk:///lib/async/zone.dart 1321:34                           _CustomZone.registerCallback
  org-dartlang-sdk:///lib/async/zone.dart 1248:22                           _CustomZone.bindCallbackGuarded
  org-dartlang-sdk:///lib/async/timer.dart 55:37                            Object.Timer.Timer
  package:sentry/src/metrics/metrics_aggregator.dart 125:9                  MetricsAggregator._scheduleFlush
  package:sentry/src/metrics/metrics_aggregator.dart 169:5                  <fn>
  org-dartlang-sdk:///lib/_internal/js_runtime/lib/async_patch.dart 307:19  _wrapJsFunctionForAsync.closure.$protected
  ===== asynchronous gap ===========================
  org-dartlang-sdk:///lib/async/zone.dart 1336:34                           _CustomZone.registerBinaryCallback
  org-dartlang-sdk:///lib/async/zone.dart 596:30                            Object._wrapJsFunctionForAsync
  package:sentry/src/metrics/metrics_aggregator.dart 125:51                 MetricsAggregator._scheduleFlush.<fn>
  ===== asynchronous gap ===========================
  org-dartlang-sdk:///lib/async/zone.dart 1321:34                           _CustomZone.registerCallback
  org-dartlang-sdk:///lib/async/zone.dart 1248:22                           _CustomZone.bindCallbackGuarded
  org-dartlang-sdk:///lib/async/timer.dart 55:37                            Object.Timer.Timer
  package:sentry/src/metrics/metrics_aggregator.dart 125:9                  MetricsAggregator._scheduleFlush
  package:sentry/src/metrics/metrics_aggregator.dart 169:5                  <fn>
  org-dartlang-sdk:///lib/_internal/js_runtime/lib/async_patch.dart 307:19  _wrapJsFunctionForAsync.closure.$protected
  ===== asynchronous gap ===========================
  org-dartlang-sdk:///lib/async/zone.dart 1336:34                           _CustomZone.registerBinaryCallback
  org-dartlang-sdk:///lib/async/zone.dart 596:30                            Object._wrapJsFunctionForAsync
  package:sentry/src/metrics/metrics_aggregator.dart 125:51                 MetricsAggregator._scheduleFlush.<fn>
  ===== asynchronous gap ===========================
  org-dartlang-sdk:///lib/async/zone.dart 1321:34                           _CustomZone.registerCallback
  org-dartlang-sdk:///lib/async/zone.dart 1248:22                           _CustomZone.bindCallbackGuarded
  org-dartlang-sdk:///lib/async/timer.dart 55:37                            Object.Timer.Timer
  package:sentry/src/metrics/metrics_aggregator.dart 125:9                  MetricsAggregator._scheduleFlush
  package:sentry/src/metrics/metrics_aggregator.dart 169:5                  <fn>
  org-dartlang-sdk:///lib/_internal/js_runtime/lib/async_patch.dart 307:19  _wrapJsFunctionForAsync.closure.$protected
  ===== asynchronous gap ===========================
  org-dartlang-sdk:///lib/async/zone.dart 1336:34                           _CustomZone.registerBinaryCallback
  org-dartlang-sdk:///lib/async/zone.dart 596:30                            Object._wrapJsFunctionForAsync
  package:sentry/src/metrics/metrics_aggregator.dart 125:51                 MetricsAggregator._scheduleFlush.<fn>
  ===== asynchronous gap ===========================
  org-dartlang-sdk:///lib/async/zone.dart 1321:34                           _CustomZone.registerCallback
  org-dartlang-sdk:///lib/async/zone.dart 1248:22                           _CustomZone.bindCallbackGuarded
  org-dartlang-sdk:///lib/async/timer.dart 55:37                            Object.Timer.Timer
  package:sentry/src/metrics/metrics_aggregator.dart 125:9                  MetricsAggregator._scheduleFlush
  package:sentry/src/metrics/metrics_aggregator.dart 169:5                  <fn>
  org-dartlang-sdk:///lib/_internal/js_runtime/lib/async_patch.dart 307:19  _wrapJsFunctionForAsync.closure.$protected
  ===== asynchronous gap ===========================
  org-dartlang-sdk:///lib/async/zone.dart 1336:34                           _CustomZone.registerBinaryCallback
  org-dartlang-sdk:///lib/async/zone.dart 596:30                            Object._wrapJsFunctionForAsync
  package:sentry/src/metrics/metrics_aggregator.dart 125:51                 MetricsAggregator._scheduleFlush.<fn>
  ===== asynchronous gap ===========================
  org-dartlang-sdk:///lib/async/zone.dart 1321:34                           _CustomZone.registerCallback
  org-dartlang-sdk:///lib/async/zone.dart 1248:22                           _CustomZone.bindCallbackGuarded
  org-dartlang-sdk:///lib/async/timer.dart 55:37                            Object.Timer.Timer
  package:sentry/src/metrics/metrics_aggregator.dart 125:9                  MetricsAggregator._scheduleFlush
  package:sentry/src/metrics/metrics_aggregator.dart 113:5                  MetricsAggregator.emit
  test/metrics/metrics_aggregator_test.dart 492:5                           <fn>
  ===== asynchronous gap ===========================
  org-dartlang-sdk:///lib/async/zone.dart 1336:34                           _CustomZone.registerBinaryCallback
  org-dartlang-sdk:///lib/async/zone.dart 596:30                            Object._wrapJsFunctionForAsync
  package:test_api                                                          <fn>
  org-dartlang-sdk:///lib/_internal/js_runtime/lib/async_patch.dart 307:19  _wrapJsFunctionForAsync.closure.$protected
  org-dartlang-sdk:///lib/_internal/js_runtime/lib/async_patch.dart 332:23  _wrapJsFunctionForAsync.<fn>
  ===== asynchronous gap ===========================
  org-dartlang-sdk:///lib/async/zone.dart 1336:34                           _CustomZone.registerBinaryCallback
  org-dartlang-sdk:///lib/async/zone.dart 596:30                            Object._wrapJsFunctionForAsync
  org-dartlang-sdk:///lib/async/zone.dart 1399:12                           StaticClosure._rootRun
  org-dartlang-sdk:///lib/async/zone.dart 1300:34                           _CustomZone.run
  org-dartlang-sdk:///lib/async/zone.dart 1804:10                           Object._runZoned
  ===== asynchronous gap ===========================
  org-dartlang-sdk:///lib/async/zone.dart 1336:34                           _CustomZone.registerBinaryCallback
  org-dartlang-sdk:///lib/async/zone.dart 596:30                            Object._wrapJsFunctionForAsync
  package:test_api                                                          <fn>
  org-dartlang-sdk:///lib/_internal/js_runtime/lib/async_patch.dart 307:19  _wrapJsFunctionForAsync.closure.$protected
  org-dartlang-sdk:///lib/_internal/js_runtime/lib/async_patch.dart 332:23  _wrapJsFunctionForAsync.<fn>
  ===== asynchronous gap ===========================
  org-dartlang-sdk:///lib/async/zone.dart 1336:34                           _CustomZone.registerBinaryCallback
  org-dartlang-sdk:///lib/async/zone.dart 596:30                            Object._wrapJsFunctionForAsync
  org-dartlang-sdk:///lib/async/zone.dart 1399:12                           StaticClosure._rootRun
  org-dartlang-sdk:///lib/async/zone.dart 1300:34                           _CustomZone.run
  org-dartlang-sdk:///lib/async/zone.dart 1804:10                           Object._runZoned
  ===== asynchronous gap ===========================
  org-dartlang-sdk:///lib/async/zone.dart 1336:34                           _CustomZone.registerBinaryCallback
  org-dartlang-sdk:///lib/async/zone.dart 596:30                            Object._wrapJsFunctionForAsync
  org-dartlang-sdk:///lib/async/zone.dart 1399:12                           StaticClosure._rootRun
  org-dartlang-sdk:///lib/async/zone.dart 1300:34                           _CustomZone.run
  org-dartlang-sdk:///lib/async/zone.dart 1804:10                           Object._runZoned

@buenaflor
Copy link
Contributor

@stefanosiano since we're deprecating metrics, should we remove the tests now?

@buenaflor
Copy link
Contributor

buenaflor commented Sep 30, 2024

We discussed this and tests are going to be deleted in PR #2277

@buenaflor buenaflor closed this as not planned Won't fix, can't repro, duplicate, stale Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

2 participants