From 60d9525253fbf96eb209fc3f56df8b4706cbfd62 Mon Sep 17 00:00:00 2001 From: m-nash <64171366+m-nash@users.noreply.github.com> Date: Wed, 23 Jun 2021 13:44:06 -0700 Subject: [PATCH] update to use zero wait on playback (#22066) * update to use zero wait on playback * update resourcemanager ci to run when shared files change * one more mgmt shared folder --- .../Redesign/ManagementRecordedTestBase.cs | 13 +++++++++++++ eng/Packages.Data.props | 2 +- sdk/resourcemanager/ci.yml | 2 ++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/common/ManagementTestShared/Redesign/ManagementRecordedTestBase.cs b/common/ManagementTestShared/Redesign/ManagementRecordedTestBase.cs index c5fa05237fb93..bb21aec950959 100644 --- a/common/ManagementTestShared/Redesign/ManagementRecordedTestBase.cs +++ b/common/ManagementTestShared/Redesign/ManagementRecordedTestBase.cs @@ -9,6 +9,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Reflection; using System.Threading.Tasks; namespace Azure.ResourceManager.TestFramework @@ -32,12 +33,24 @@ protected ManagementRecordedTestBase(bool isAsync) : base(isAsync) { SessionEnvironment = new TEnvironment(); SessionEnvironment.Mode = Mode; + Initialize(); } protected ManagementRecordedTestBase(bool isAsync, RecordedTestMode mode) : base(isAsync, mode) { SessionEnvironment = new TEnvironment(); SessionEnvironment.Mode = Mode; + Initialize(); + } + + private void Initialize() + { + if (Mode == RecordedTestMode.Playback) + { + var opInternalType = typeof(OperationInternals); + var pollField = opInternalType.GetField("k__BackingField", BindingFlags.Static | BindingFlags.NonPublic); + pollField.SetValue(null, TimeSpan.Zero); + } } private ArmClient GetCleanupClient() diff --git a/eng/Packages.Data.props b/eng/Packages.Data.props index 5b28e36f1d1f7..7471a1956abe1 100644 --- a/eng/Packages.Data.props +++ b/eng/Packages.Data.props @@ -137,7 +137,7 @@ All should have PrivateAssets="All" set so they don't become pacakge dependencies --> - + diff --git a/sdk/resourcemanager/ci.yml b/sdk/resourcemanager/ci.yml index 68b222242f134..266b7bdacddb1 100644 --- a/sdk/resourcemanager/ci.yml +++ b/sdk/resourcemanager/ci.yml @@ -20,6 +20,8 @@ pr: paths: include: - sdk/resourcemanager/ + - common/ManagementTestShared/ + - common/ManagementCoreShared/ extends: template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml