Skip to content

[Azure Functions] Logging E2E flakes when host log records share a physical line #330

Open

Description

@andystaples

Failure

tests/azure-functions-durable/e2e/test_logging_e2e.py::test_client_and_worker_logs_flow_through_host can fail even when the orchestration completes and the expected SDK message appears with the Functions host timestamp prefix.

Observed in the e2e-tests (strict-typing=0) job on #329:

  • Failed job and logs
  • Commit: 3dc0afceb7b565d191f457907367d467c8e152d3
  • Ubuntu runner, Python 3.13.17; nox -s functions_e2e
  • Result: 1 failed, 83 passed, 6 skipped. The strict-typing=1 job passed.

The orchestration reached COMPLETED. The assertion failed at test_logging_e2e.py:16, called from line 31:

assert re.fullmatch(rf"\[[^\]]+Z\] {re.escape(message)}", line)

The captured line began with the complete expected message, immediately followed by another timestamped host/storage record on the same physical line:

[2026-11-02T19:42:58.870Z] Starting new 'activity_chain' instance with ID = 'da25aeb425694ab08c8503f48a57f29c'.[2026-...

The pytest representation truncates the intervening text, but shows an Azure Storage request URL later in the same string. Full Functions host logs are attached to the workflow run as func-host-logs-strict-0.

Likely cause

FunctionApp.wait_for_host_log() returns the first matching physical line from the shared host stdout/stderr capture. _assert_host_routed() assumes that this line contains exactly one host log record. Adjacent records without a separating newline violate that assumption even though the expected record is present with the correct prefix. The observed failure is a log-record framing issue; the underlying writer/interleaving mechanism still needs investigation.

#329 changes only core large-payload tests, which this Functions E2E invocation does not collect. Neither the logging assertion nor its host harness is changed there.

Expected behavior

The logging test should tolerate adjacent/interleaved host records while still verifying that SDK messages are routed through the Functions host, rather than weakening the assertion to an unrestricted substring check. Preserve the existing coverage for host category filtering.

Follow-up

Investigate the captured host output and make the test's record extraction robust to physical-line framing. Keep this separate from the missing-payload worker isolation coverage in #329.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions