Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion sentry_sdk/integrations/gcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,12 @@ def sentry_func(functionhandler, gcp_event, *args, **kwargs):
):
waiting_time = configured_time - TIMEOUT_WARNING_BUFFER

timeout_thread = TimeoutThread(waiting_time, configured_time)
timeout_thread = TimeoutThread(
waiting_time,
configured_time,
isolation_scope=scope,
current_scope=sentry_sdk.get_current_scope(),
)

# Starting the thread to raise timeout warning exception
timeout_thread.start()
Expand Down
3 changes: 3 additions & 0 deletions tests/integrations/gcp/test_gcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ def test_timeout_error(run_cloud_function):
functionhandler = None
event = {}
def cloud_function(functionhandler, event):
sentry_sdk.set_tag("cloud_function", "true")
time.sleep(10)
return "3"
"""
Expand All @@ -219,6 +220,8 @@ def cloud_function(functionhandler, event):
assert exception["mechanism"]["type"] == "threading"
assert not exception["mechanism"]["handled"]

assert envelope_items[0]["tags"]["cloud_function"] == "true"


def test_performance_no_error(run_cloud_function):
envelope_items, _ = run_cloud_function(
Expand Down