diff --git a/.azure-pipelines/build-job.yml b/.azure-pipelines/build-job.yml index 8f560d4300..f82a0d4cc4 100644 --- a/.azure-pipelines/build-job.yml +++ b/.azure-pipelines/build-job.yml @@ -138,6 +138,7 @@ jobs: - script: ${{ variables.devCommand }} testl0 Debug ${{ parameters.os }}-${{ parameters.arch }} workingDirectory: src displayName: Unit tests + timeoutInMinutes: 5 # Install nuget - ${{ if eq(parameters.os, 'win') }}: diff --git a/src/Agent.Sdk/Knob/AgentKnobs.cs b/src/Agent.Sdk/Knob/AgentKnobs.cs index 2bbf5fbff4..0b58084988 100644 --- a/src/Agent.Sdk/Knob/AgentKnobs.cs +++ b/src/Agent.Sdk/Knob/AgentKnobs.cs @@ -519,10 +519,10 @@ public class AgentKnobs new EnvironmentKnobSource("AZP_AGENT_IGNORE_VSTSTASKLIB"), new BuiltInDefaultKnobSource("false")); - public static readonly Knob DisableTaskDeprecationCheck = new Knob( - nameof(DisableTaskDeprecationCheck), - "Disables the task deprecation check.", - new EnvironmentKnobSource("AZP_AGENT_DISABLE_TASK_DEPRECATION_CHECK"), + public static readonly Knob CheckForTaskDeprecation = new Knob( + nameof(CheckForTaskDeprecation), + "If true, the agent will check in the 'Initialize job' step each task used in the job for task deprecation.", + new EnvironmentKnobSource("AZP_AGENT_CHECK_FOR_TASK_DEPRECATION"), new BuiltInDefaultKnobSource("false")); } } diff --git a/src/Agent.Worker/TaskManager.cs b/src/Agent.Worker/TaskManager.cs index d5f82cd449..8c4c370d01 100644 --- a/src/Agent.Worker/TaskManager.cs +++ b/src/Agent.Worker/TaskManager.cs @@ -77,9 +77,9 @@ into taskGrouping await DownloadAsync(executionContext, task); - if (!AgentKnobs.DisableTaskDeprecationCheck.GetValue(UtilKnobValueContext.Instance()).AsBoolean()) + if (AgentKnobs.CheckForTaskDeprecation.GetValue(UtilKnobValueContext.Instance()).AsBoolean()) { - CheckTaskDeprecation(executionContext, task); + CheckForTaskDeprecation(executionContext, task); } } } @@ -315,7 +315,7 @@ private async Task DownloadAsync(IExecutionContext executionContext, Pipelines.T } } - private void CheckTaskDeprecation(IExecutionContext executionContext, Pipelines.TaskStepDefinitionReference task) + private void CheckForTaskDeprecation(IExecutionContext executionContext, Pipelines.TaskStepDefinitionReference task) { string taskJsonPath = Path.Combine(GetDirectory(task), "task.json"); string taskJsonText = File.ReadAllText(taskJsonPath);