From 12c3a2b8d0a40a43b66c6ff95e63407d3022c886 Mon Sep 17 00:00:00 2001 From: burnettk Date: Sat, 4 Feb 2023 00:36:17 -0500 Subject: [PATCH] hoping to fix tests on windows --- keycloak/realm_exports/spiffworkflow-realm.json | 2 +- src/spiffworkflow_backend/__init__.py | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/keycloak/realm_exports/spiffworkflow-realm.json b/keycloak/realm_exports/spiffworkflow-realm.json index bbe6ecda..0642321a 100644 --- a/keycloak/realm_exports/spiffworkflow-realm.json +++ b/keycloak/realm_exports/spiffworkflow-realm.json @@ -3572,4 +3572,4 @@ "clientPolicies" : { "policies" : [ ] } -} \ No newline at end of file +} diff --git a/src/spiffworkflow_backend/__init__.py b/src/spiffworkflow_backend/__init__.py index 341cfac8..420f990c 100644 --- a/src/spiffworkflow_backend/__init__.py +++ b/src/spiffworkflow_backend/__init__.py @@ -1,5 +1,6 @@ """__init__.""" import os +import sys from typing import Any import connexion # type: ignore @@ -203,6 +204,9 @@ def configure_sentry(app: flask.app.Flask) -> None: if sentry_traces_sample_rate is None: raise Exception("SENTRY_TRACES_SAMPLE_RATE is not set somehow") + # profiling doesn't work on windows, because of an issue like https://github.com/nvdv/vprof/issues/62 + profiles_sample_rate = 0 if sys.platform.startswith("win") else 1 + sentry_sdk.init( dsn=app.config.get("SENTRY_DSN"), integrations=[ @@ -218,8 +222,6 @@ def configure_sentry(app: flask.app.Flask) -> None: traces_sample_rate=float(sentry_traces_sample_rate), traces_sampler=traces_sampler, # The profiles_sample_rate setting is relative to the traces_sample_rate setting. - _experiments={ - "profiles_sample_rate": 1, - }, + _experiments={"profiles_sample_rate": profiles_sample_rate}, before_send=before_send, )