[Azure Functions] Stabilize isolated host lifecycle and log collection#8887
[Azure Functions] Stabilize isolated host lifecycle and log collection#8887bouwkast wants to merge 6 commits into
Conversation
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (8887) and master. ✅ No regressions detected - check the details below Full Metrics ComparisonFakeDbCommand
HttpMessageHandler
Comparison explanationExecution-time benchmarks measure the whole time it takes to execute a program, and are intended to measure the one-off costs. Cases where the execution time results for the PR are worse than latest master results are highlighted in **red**. The following thresholds were used for comparing the execution times:
Note that these results are based on a single point-in-time result for each branch. For full results, see the dashboard. Graphs show the p99 interval based on the mean and StdDev of the test run, as well as the mean value of the run (shown as a diamond below the graph). Duration chartsFakeDbCommand (.NET Framework 4.8)gantt
title Execution time (ms) FakeDbCommand (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8887) - mean (71ms) : 69, 73
master - mean (72ms) : 68, 75
section Bailout
This PR (8887) - mean (75ms) : 73, 77
master - mean (78ms) : 75, 80
section CallTarget+Inlining+NGEN
This PR (8887) - mean (1,095ms) : 1038, 1151
master - mean (1,093ms) : 1049, 1138
FakeDbCommand (.NET Core 3.1)gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8887) - mean (109ms) : 104, 113
master - mean (113ms) : 107, 120
section Bailout
This PR (8887) - mean (110ms) : 108, 111
master - mean (113ms) : 108, 118
section CallTarget+Inlining+NGEN
This PR (8887) - mean (785ms) : 765, 806
master - mean (783ms) : 763, 802
FakeDbCommand (.NET 6)gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8887) - mean (96ms) : 94, 99
master - mean (101ms) : 95, 107
section Bailout
This PR (8887) - mean (100ms) : 94, 106
master - mean (99ms) : 97, 102
section CallTarget+Inlining+NGEN
This PR (8887) - mean (943ms) : 906, 980
master - mean (944ms) : 884, 1005
FakeDbCommand (.NET 8)gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8887) - mean (98ms) : 92, 104
master - mean (97ms) : 94, 99
section Bailout
This PR (8887) - mean (97ms) : 96, 99
master - mean (100ms) : 95, 106
section CallTarget+Inlining+NGEN
This PR (8887) - mean (823ms) : 781, 864
master - mean (815ms) : 784, 846
HttpMessageHandler (.NET Framework 4.8)gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8887) - mean (210ms) : 205, 216
master - mean (216ms) : 212, 220
section Bailout
This PR (8887) - mean (214ms) : 210, 218
master - mean (220ms) : 216, 223
section CallTarget+Inlining+NGEN
This PR (8887) - mean (1,259ms) : 1204, 1313
master - mean (1,287ms) : 1243, 1331
HttpMessageHandler (.NET Core 3.1)gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8887) - mean (301ms) : 293, 308
master - mean (312ms) : 304, 320
section Bailout
This PR (8887) - mean (302ms) : 297, 308
master - mean (312ms) : 306, 317
section CallTarget+Inlining+NGEN
This PR (8887) - mean (1,008ms) : 976, 1041
master - mean (1,036ms) : 1011, 1062
HttpMessageHandler (.NET 6)gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8887) - mean (294ms) : 288, 301
master - mean (304ms) : 296, 312
section Bailout
This PR (8887) - mean (296ms) : 288, 304
master - mean (303ms) : 298, 307
section CallTarget+Inlining+NGEN
This PR (8887) - mean (1,195ms) : 1167, 1222
master - mean (1,212ms) : 1164, 1260
HttpMessageHandler (.NET 8)gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8887) - mean (292ms) : 285, 298
master - mean (302ms) : 296, 308
section Bailout
This PR (8887) - mean (293ms) : 288, 297
master - mean (302ms) : 295, 308
section CallTarget+Inlining+NGEN
This PR (8887) - mean (1,070ms) : 1002, 1139
master - mean (1,102ms) : 1004, 1200
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
BenchmarksBenchmark execution time: 2026-07-14 21:26:10 Comparing candidate commit 9a3bbe9 in PR branch Found 0 performance improvements and 2 performance regressions! Performance is the same for 70 metrics, 0 unstable metrics, 59 known flaky benchmarks, 67 flaky benchmarks without significant changes.
|
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 20ac1e9e44
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
4ab9f86 to
9a3bbe9
Compare
Summary of changes
This stabilizes the isolated Azure Functions integration tests across startup, trace and log collection, and shutdown.
Reason for change
The tests had several overlapping timing issues which are a large source of flake. The
RunOnStartuptimer could execute before the Functions HTTP listener was accepting connections, causing its self-call to fail before the downstream spans were created.At shutdown, the sample waited for a fixed delay and then terminated every
func.exeprocess. This could stop the host before its final trace batch reached the mock agent, leaving only 17 of the expected 21 spans. Reusing the same host ID could also leave timer singleton leases behind and delay later test runs.Finally, the host-logs-disabled test asserted against the first worker-log batch without waiting for later batches, which could hide a regression that re-enabled host logs.
Implementation details
The samples now wait for the host’s HTTP listener before making their self-calls. The readiness check uses
/admin/host/ping, and its spans are excluded from the test results.The tests keep the host alive until the expected spans have been received and asserted. They then call a dedicated shutdown endpoint, which allows its response to complete, flushes the worker tracer, and stops the worker. If Core Tools remains running, teardown terminates only the process tree created by that test.
Direct-submission logs can remain buffered until shutdown, so log assertions happen afterward. For the host-logs-disabled case, the test waits until the expected worker logs have arrived and the intake has remained unchanged for two seconds before checking the upper bound. It fails if the intake does not stabilize within 20 seconds.
Test coverage
relying on CI as I had some Azurite issues locally.
Other details
I thought first we could just slap a [Flaky] on these but I am not 100% sure if that will work with how these function tests actually spin up an additional process
#incident-57303