Skip to content

Commit 3c543f5

Browse files
authored
Updating FunctionsNetHost (dotnet isolated worker) to 1.0.9 (#10262)
* Updating FunctionsNetHost (dotnet isolated worker) to 1.0.9. Updated a test to reflect this change. * Updated release notes * Adjusting tests to reflect the dotnet isolated worker config changes (loads only in placeholder mode) * Update release notes with the right fix * Fixing HostLogs assertion * Revert "Fixing HostLogs assertion" This reverts commit 1d8ee86. * nit fixes from PR feedback. * Fix ValidateLogs test * nit cleanup (removed unused var, linebreak)
1 parent a3734f9 commit 3c543f5

File tree

6 files changed

+25
-4
lines changed

6 files changed

+25
-4
lines changed

release_notes.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@
1717
- Ordered invocations are now the default (#10201)
1818
- Skip worker description if none of the profile conditions are met (#9932)
1919
- Fixed incorrect function count in the log message.(#10220)
20+
- Updated dotnet-isolated worker to [1.0.9](https://github.com/Azure/azure-functions-dotnet-worker/pull/2552) (#10262)
2021
- Fix race condition on startup with extension RPC endpoints not being available. (#10255)
21-
- Adding a timeout when retrieving function metadata from metadata providers (#10219)
22+
- Adding a timeout when retrieving function metadata from metadata providers (#10219)

src/WebJobs.Script/WebJobs.Script.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
<PackageReference Include="Microsoft.ApplicationInsights.WindowsServer" Version="2.22.0" />
5050
<PackageReference Include="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel" Version="2.22.0" />
5151
<PackageReference Include="Microsoft.AspNetCore.Mvc.WebApiCompatShim" Version="2.2.0" NoWarn="NU1701" />
52-
<PackageReference Include="Microsoft.Azure.Functions.DotNetIsolatedNativeHost" Version="1.0.8" />
52+
<PackageReference Include="Microsoft.Azure.Functions.DotNetIsolatedNativeHost" Version="1.0.9" />
5353
<PackageReference Include="Microsoft.Azure.WebJobs" Version="3.0.41-11331" />
5454
<PackageReference Include="Microsoft.Azure.WebJobs.Host.Storage" Version="5.0.0-beta.2-11957" />
5555
<PackageReference Include="Microsoft.Extensions.Azure" Version="1.7.0" />

test/WebJobs.Script.Tests.Integration/ApplicationInsights/ApplicationInsightsEndToEndTestsBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ await TestHelpers.Await(() =>
271271
// in class LanguageWorkerOptionsSetup.cs -> Configure()
272272
// which is giving extra log lines for node worker
273273
traces = traces.Where(t =>
274-
!t.Message.Contains("Skipping WorkerConfig for language")
274+
!t.Message.Contains("Skipping WorkerConfig for language") && !t.Message.Contains("Skipping WorkerConfig for stack")
275275
).ToArray();
276276

277277
int expectedCount = 16;

test/WebJobs.Script.Tests/Configuration/LanguageWorkerOptionsSetupTests.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,26 @@ public void LanguageWorkerOptions_Expected_ListOfConfigs(string workerRuntime)
3131
{
3232
testEnvironment.SetEnvironmentVariable(RpcWorkerConstants.FunctionWorkerRuntimeSettingName, workerRuntime);
3333
}
34+
else
35+
{
36+
// The dotnet-isolated worker only runs in placeholder mode. Setting the placeholder environment to 1 for the test.
37+
testEnvironment.SetEnvironmentVariable(EnvironmentSettingNames.AzureWebsitePlaceholderMode, "1");
38+
}
39+
40+
testProfileManager.Setup(pm => pm.LoadWorkerDescriptionFromProfiles(It.IsAny<RpcWorkerDescription>(), out It.Ref<RpcWorkerDescription>.IsAny))
41+
.Callback((RpcWorkerDescription defaultDescription, out RpcWorkerDescription outDescription) =>
42+
{
43+
// dotnet-isolated worker config does not have "DefaultExecutablePath" in the parent level.So, we should set it from a profile.
44+
if (defaultDescription.Language == "dotnet-isolated")
45+
{
46+
outDescription = new RpcWorkerDescription() { DefaultExecutablePath = "testPath", Language = "dotnet-isolated" };
47+
}
48+
else
49+
{
50+
// for other workers, we should return the default description as they have the "DefaultExecutablePath" in the parent level.
51+
outDescription = defaultDescription;
52+
}
53+
});
3454

3555
LanguageWorkerOptionsSetup setup = new LanguageWorkerOptionsSetup(configuration, NullLoggerFactory.Instance, testEnvironment, testMetricLogger, testProfileManager.Object);
3656
LanguageWorkerOptions options = new LanguageWorkerOptions();

test/WebJobs.Script.Tests/ScriptHostTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1600,7 +1600,6 @@ public async Task Initialize_LogsWarningForExplicitlySetHostId()
16001600

16011601
[Theory]
16021602
[InlineData("python", "main.py", "python", "python")]
1603-
[InlineData("dotnet-isolated", "app.dll", "dotnet-isolated", "dotnet-isolated")]
16041603
[InlineData("dotnet", "app.dll", "dotnet", DotNetScriptTypes.DotNetAssembly)]
16051604
[InlineData(null, "app.dll", "dotnet", DotNetScriptTypes.DotNetAssembly)] // if FUNCTIONS_WORKER_RUNTIME is missing, assume dotnet
16061605
public async Task Initialize_MissingWorkerRuntime_SetsCorrectRuntimeFromFunctionMetadata(string functionsWorkerRuntime, string scriptFile, string expectedMetricLanguage, string expectedMetadataLanguage)

test/WebJobs.Script.Tests/Workers/Rpc/RpcWorkerConfigFactoryTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ public void DefaultWorkerConfigs_Overrides_DefaultWorkerRuntimeVersion_AppSettin
153153
var config = configBuilder.Build();
154154
var scriptSettingsManager = new ScriptSettingsManager(config);
155155
var testLogger = new TestLogger("test");
156+
_testEnvironment.SetEnvironmentVariable(EnvironmentSettingNames.AzureWebsitePlaceholderMode, "1");
156157
using (var variables = new TestScopedSettings(scriptSettingsManager, testEnvVariables))
157158
{
158159
var configFactory = new RpcWorkerConfigFactory(config, testLogger, _testSysRuntimeInfo, _testEnvironment, new TestMetricsLogger(), _testWorkerProfileManager);

0 commit comments

Comments
 (0)