Uploaded image for project: 'Nuxeo Drive '
  1. Nuxeo Drive
  2. NXDRIVE-2603

Fix test_flooding_prevention() when run from tox

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.1.0
    • Fix Version/s: 5.2.0
    • Component/s: Tests

      Description

      When run from tox, the test fail almost every time:

          def test_flooding_prevention(sentry_init_custom):
              """Ensure that an infinite synchronization due to a unhandled error
              will not explode the Sentry quota.
              """
          
              def whoopsy():
                  """Problematic function ... """
                  try:
                      raise ValueError("Mock'ed error")
                  except Exception:
                      capture_exception()
          
              def whoopsy2():
                  """Problematic function ... """
                  try:
                      raise ValueError("Mock'ed error")
                  except Exception:
                      capture_exception()
          
              sentry_init_custom(before_send=nxdrive.tracing.before_send)
          
              # Ensure there is no event by default
              assert not nxdrive.tracing._EVENTS
          
              # The first event of an error should be sent
              whoopsy()
      >       assert len(nxdrive.tracing._EVENTS) == 1
      E       AssertionError: assert 0 == 1
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 30 minutes
                  30m

                    PagerDuty

                    Error rendering 'com.pagerduty.jira-server-plugin:PagerDuty'. Please contact your Jira administrators.