Skip to content

Commit 452f253

Browse files
committed
Fix collector output permissions in CI
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: b872ac61-5bac-40e3-b9c7-daf295725fde
1 parent 450b312 commit 452f253

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

tests/azure-functions-durable/e2e/_harness.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ def start(self) -> None:
115115
raise RuntimeError("Docker is required for the tracing E2E test.")
116116

117117
self.work_dir.mkdir(parents=True, exist_ok=True)
118+
if os.name != "nt":
119+
# The collector image runs as UID/GID 10001, while pytest creates
120+
# temporary directories as owner-only on Linux.
121+
self.work_dir.chmod(0o777)
118122
self.config_path.write_text(
119123
"receivers:\n"
120124
" otlp:\n"
@@ -196,6 +200,19 @@ def get_spans(self) -> list[dict[str, Any]]:
196200
spans.append({**span, "scopeName": scope_name})
197201
return spans
198202

203+
def get_logs(self) -> str:
204+
"""Return collector container logs for assertion diagnostics."""
205+
docker = shutil.which("docker")
206+
if docker is None:
207+
return "Docker is not available."
208+
result = subprocess.run(
209+
[docker, "logs", self.container_name],
210+
capture_output=True,
211+
check=False,
212+
text=True,
213+
)
214+
return result.stdout + result.stderr
215+
199216

200217
@dataclass
201218
class HttpResult:

tests/azure-functions-durable/e2e/test_distributed_tracing_e2e.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def test_user_span_correlates_to_host_without_worker_lifecycle_duplicates(
4949
break
5050
time.sleep(0.5)
5151

52-
assert len(user_spans) == 1
52+
assert len(user_spans) == 1, collector.get_logs()
5353
user_span = user_spans[0]
5454
summary = [
5555
(

0 commit comments

Comments
 (0)