Skip to content

Commit 278e7a4

Browse files
.
1 parent 565358e commit 278e7a4

1 file changed

Lines changed: 8 additions & 15 deletions

File tree

tests/integrations/ray/test_ray.py

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,7 @@ def test_tracing_in_ray_tasks(task_options, task, span_streaming):
196196
try:
197197
ray.init(
198198
runtime_env={
199-
"worker_process_setup_hook": setup_sentry_with_logging_transport_and_span_streaming
200-
if span_streaming
201-
else setup_sentry,
199+
"worker_process_setup_hook": setup_sentry_with_logging_transport_and_span_streaming,
202200
"working_dir": "./",
203201
},
204202
_temp_dir=ray_temp_dir,
@@ -252,9 +250,7 @@ def test_tracing_in_ray_tasks(task_options, task, span_streaming):
252250
else:
253251
ray.init(
254252
runtime_env={
255-
"worker_process_setup_hook": setup_sentry_with_logging_transport_and_span_streaming
256-
if span_streaming
257-
else setup_sentry,
253+
"worker_process_setup_hook": setup_sentry,
258254
"working_dir": "./",
259255
}
260256
)
@@ -389,7 +385,7 @@ def increment(self):
389385
):
390386
self.n += 1
391387

392-
return sentry_sdk.get_client().transport.envelopes
388+
return sentry_sdk.get_client().transport.envelopes
393389
else:
394390

395391
@ray.remote
@@ -409,7 +405,7 @@ def increment(self):
409405
):
410406
self.n += 1
411407

412-
return sentry_sdk.get_client().transport.envelopes
408+
return sentry_sdk.get_client().transport.envelopes
413409

414410
if span_streaming:
415411
ray_temp_dir = os.path.join("/tmp", f"ray_test_{uuid.uuid4().hex[:8]}")
@@ -418,9 +414,7 @@ def increment(self):
418414
try:
419415
ray.init(
420416
runtime_env={
421-
"worker_process_setup_hook": setup_sentry_with_span_streaming
422-
if span_streaming
423-
else setup_sentry,
417+
"worker_process_setup_hook": setup_sentry_with_logging_transport_and_span_streaming,
424418
"working_dir": "./",
425419
},
426420
_temp_dir=ray_temp_dir,
@@ -429,7 +423,8 @@ def increment(self):
429423
with sentry_sdk.traces.start_span(
430424
name="ray test parent", attributes={"sentry.op": "task"}
431425
):
432-
future = example_task.remote(span_streaming)
426+
counter = Counter.remote()
427+
future = counter.increment.remote()
433428
ray.get(future)
434429

435430
job_id = future.job_id().hex()
@@ -456,9 +451,7 @@ def increment(self):
456451
else:
457452
ray.init(
458453
runtime_env={
459-
"worker_process_setup_hook": setup_sentry_with_span_streaming
460-
if span_streaming
461-
else setup_sentry,
454+
"worker_process_setup_hook": setup_sentry,
462455
"working_dir": "./",
463456
}
464457
)

0 commit comments

Comments
 (0)