|
9 | 9 | using System.Net.Http; |
10 | 10 | using System.Threading; |
11 | 11 | using System.Threading.Tasks; |
12 | | -using Castle.Core.Logging; |
13 | 12 | using Microsoft.Azure.WebJobs.Script.Diagnostics; |
14 | 13 | using Microsoft.Azure.WebJobs.Script.WebHost; |
15 | 14 | using Microsoft.Azure.WebJobs.Script.WebHost.Management; |
@@ -974,16 +973,19 @@ public async Task Does_Not_Mount_Invalid_BYOS_Accounts() |
974 | 973 |
|
975 | 974 | var meshInitServiceClient = new Mock<IMeshServiceClient>(MockBehavior.Strict); |
976 | 975 |
|
| 976 | + bool called = false; |
977 | 977 | meshInitServiceClient.Setup(client => |
978 | | - client.MountCifs(Utility.BuildStorageConnectionString(account1, accessKey1, CloudConstants.AzureStorageSuffix), share1, targetPath1)).Returns(Task.FromResult(true)); |
| 978 | + client.MountCifs(Utility.BuildStorageConnectionString(account1, accessKey1, CloudConstants.AzureStorageSuffix), share1, targetPath1)) |
| 979 | + .Returns(Task.FromResult(true)) |
| 980 | + .Callback(() => called = true); |
979 | 981 |
|
980 | 982 | var instanceManager = new AtlasInstanceManager(_optionsFactory, _httpClientFactory, _scriptWebEnvironment, _environment, |
981 | 983 | _loggerFactory.CreateLogger<AtlasInstanceManager>(), new TestMetricsLogger(), meshInitServiceClient.Object, |
982 | 984 | _runFromPackageHandler, _packageDownloadHandler.Object); |
983 | 985 |
|
984 | 986 | instanceManager.StartAssignment(hostAssignmentContext); |
985 | 987 |
|
986 | | - await Task.Delay(TimeSpan.FromSeconds(0.5)); |
| 988 | + await TestHelpers.Await(() => called); |
987 | 989 |
|
988 | 990 | meshInitServiceClient.Verify( |
989 | 991 | client => client.MountCifs(Utility.BuildStorageConnectionString(account1, accessKey1, CloudConstants.AzureStorageSuffix), share1, |
|
0 commit comments