Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AzDevOpsProject: Integration tests fails intermittently with timeout error #25

Closed
johlju opened this issue Jan 26, 2021 · 5 comments · Fixed by #28
Closed

AzDevOpsProject: Integration tests fails intermittently with timeout error #25

johlju opened this issue Jan 26, 2021 · 5 comments · Fixed by #28
Labels
bug The issue is a bug. tests The issue or pull request is about tests only.

Comments

@johlju
Copy link
Member

johlju commented Jan 26, 2021

Details of the scenario you tried and the problem that is occurring

Integration tests is throwing a timeout error.

      [-] Should not throw when compiling MOF and when calling "Start-DscConfiguration" 11.32s
        Expected no exception to be thrown, but an exception "PowerShell DSC resource AzureDevOpsDsc  failed to execute Set functionality with error message: System.InvalidOperationException: The 'Wait-AzDevOpsOperation' function (using OperationId of '8b09a49e-8e81-44fb-909f-85dcf9f9340e') exceeded specified, maximum timeout (10000 milliseconds). (AZDEVOPSCOMMON0702) " was thrown from D:\a\1\s\tests\Integration\DSCClassResources\AzDevOpsProject.Integration.Tests.ps1:514 char:21
            + ...               Start-DscConfiguration @startDscConfigurationParameters
            +                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.
        515:                 } | Should -Not -Throw
        at <ScriptBlock>, D:\a\1\s\tests\Integration\DSCClassResources\AzDevOpsProject.Integration.Tests.ps1: line 495

Verbose logs showing the problem

https://dev.azure.com/dsccommunity/AzureDevOpsDsc/_build/results?buildId=3735&view=logs&j=893fd6d3-ee14-5383-e15d-24a2acc7f145&t=417fa350-1299-5d83-5f55-4c06f3da5c2a&l=866

2021-01-26T09:24:10.3197400Z     Context When compiling, applying and testing the MOF - 'AzDevOpsProject_EnsureProjectPresent_Config'
2021-01-26T09:24:10.5639194Z VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = 
2021-01-26T09:24:10.5640109Z SendConfigurationApply,'className' = MSFT_DSCLocalConfigurationManager,'namespaceName' = 
2021-01-26T09:24:10.5642611Z root/Microsoft/Windows/DesiredStateConfiguration'.
2021-01-26T09:24:10.5649544Z VERBOSE: An LCM method call arrived from computer fv-az124-319 with user sid 
2021-01-26T09:24:10.5651230Z S-1-5-21-4017747932-1028059775-3929666197-500.
2021-01-26T09:24:10.5655992Z VERBOSE: [fv-az124-319]: LCM:  [ Start  Set      ]
2021-01-26T09:24:10.5749029Z VERBOSE: [fv-az124-319]: LCM:  [ Start  Resource ]  [[AzDevOpsProject]Integration_Test_EnsureProjectPresent]
2021-01-26T09:24:10.5753987Z VERBOSE: [fv-az124-319]: LCM:  [ Start  Test     ]  [[AzDevOpsProject]Integration_Test_EnsureProjectPresent]
2021-01-26T09:24:10.5758045Z VERBOSE: [fv-az124-319]:                            [[AzDevOpsProject]Integration_Test_EnsureProjectPresent] GET 
2021-01-26T09:24:10.5759761Z https://dev.azure.com/azuredevopsdsc/_apis/projects?includeCapabilities=true&api-version=6.0 with 0-byte payload
2021-01-26T09:24:10.7236121Z VERBOSE: [fv-az124-319]:                            [[AzDevOpsProject]Integration_Test_EnsureProjectPresent] received 
2021-01-26T09:24:10.7237268Z 22-byte response of content type application/json; charset=utf-8; api-version=6.0
2021-01-26T09:24:10.7287484Z VERBOSE: [fv-az124-319]:                            [[AzDevOpsProject]Integration_Test_EnsureProjectPresent] 
2021-01-26T09:24:10.7320843Z DscActionRequired='New'
2021-01-26T09:24:10.7334110Z VERBOSE: [fv-az124-319]: LCM:  [ End    Test     ]  [[AzDevOpsProject]Integration_Test_EnsureProjectPresent]  in 0.1820
2021-01-26T09:24:10.7334812Z  seconds.
2021-01-26T09:24:10.7340163Z VERBOSE: [fv-az124-319]: LCM:  [ Start  Set      ]  [[AzDevOpsProject]Integration_Test_EnsureProjectPresent]
2021-01-26T09:24:10.7484807Z VERBOSE: [fv-az124-319]:                            [[AzDevOpsProject]Integration_Test_EnsureProjectPresent] GET 
2021-01-26T09:24:10.7487306Z https://dev.azure.com/azuredevopsdsc/_apis/projects?includeCapabilities=true&api-version=6.0 with 0-byte payload
2021-01-26T09:24:10.9099464Z VERBOSE: [fv-az124-319]:                            [[AzDevOpsProject]Integration_Test_EnsureProjectPresent] received 
2021-01-26T09:24:10.9105873Z 22-byte response of content type application/json; charset=utf-8; api-version=6.0
2021-01-26T09:24:10.9158259Z VERBOSE: [fv-az124-319]:                            [[AzDevOpsProject]Integration_Test_EnsureProjectPresent] 
2021-01-26T09:24:10.9160132Z DscActionRequired='New'
2021-01-26T09:24:10.9218727Z VERBOSE: [fv-az124-319]:                            [[AzDevOpsProject]Integration_Test_EnsureProjectPresent] GET 
2021-01-26T09:24:10.9219342Z https://dev.azure.com/azuredevopsdsc/_apis/projects?includeCapabilities=true&api-version=6.0 with 0-byte payload
2021-01-26T09:24:11.0801777Z VERBOSE: [fv-az124-319]:                            [[AzDevOpsProject]Integration_Test_EnsureProjectPresent] received 
2021-01-26T09:24:11.0802810Z 22-byte response of content type application/json; charset=utf-8; api-version=6.0
2021-01-26T09:24:11.0882874Z VERBOSE: [fv-az124-319]:                            [[AzDevOpsProject]Integration_Test_EnsureProjectPresent] POST 
2021-01-26T09:24:11.0883925Z https://dev.azure.com/azuredevopsdsc/_apis/projects?includeCapabilities=true&api-version=6.0 with -1-byte payload
2021-01-26T09:24:11.3340248Z VERBOSE: [fv-az124-319]:                            [[AzDevOpsProject]Integration_Test_EnsureProjectPresent] received 
2021-01-26T09:24:11.3341256Z 162-byte response of content type application/json; charset=utf-8; api-version=6.0
2021-01-26T09:24:11.3415900Z VERBOSE: [fv-az124-319]:                            [[AzDevOpsProject]Integration_Test_EnsureProjectPresent] GET 
2021-01-26T09:24:11.3416575Z https://dev.azure.com/azuredevopsdsc/_apis/operations/8b09a49e-8e81-44fb-909f-85dcf9f9340e?includeCapabilities=true&api
2021-01-26T09:24:11.3417014Z -version=6.0 with 0-byte payload
2021-01-26T09:24:11.5045436Z VERBOSE: [fv-az124-319]:                            [[AzDevOpsProject]Integration_Test_EnsureProjectPresent] received 
2021-01-26T09:24:11.5047707Z 286-byte response of content type application/json; charset=utf-8; api-version=6.0
2021-01-26T09:24:12.0121636Z VERBOSE: [fv-az124-319]:                            [[AzDevOpsProject]Integration_Test_EnsureProjectPresent] GET 
2021-01-26T09:24:12.0122375Z https://dev.azure.com/azuredevopsdsc/_apis/operations/8b09a49e-8e81-44fb-909f-85dcf9f9340e?includeCapabilities=true&api
2021-01-26T09:24:12.0122765Z -version=6.0 with 0-byte payload
2021-01-26T09:24:12.2119760Z VERBOSE: [fv-az124-319]:                            [[AzDevOpsProject]Integration_Test_EnsureProjectPresent] received 
2021-01-26T09:24:12.2120759Z 286-byte response of content type application/json; charset=utf-8; api-version=6.0
2021-01-26T09:24:12.7200008Z VERBOSE: [fv-az124-319]:                            [[AzDevOpsProject]Integration_Test_EnsureProjectPresent] GET 
2021-01-26T09:24:12.7200747Z https://dev.azure.com/azuredevopsdsc/_apis/operations/8b09a49e-8e81-44fb-909f-85dcf9f9340e?includeCapabilities=true&api
2021-01-26T09:24:12.7201175Z -version=6.0 with 0-byte payload
2021-01-26T09:24:12.8872415Z VERBOSE: [fv-az124-319]:                            [[AzDevOpsProject]Integration_Test_EnsureProjectPresent] received 
2021-01-26T09:24:12.8873405Z 286-byte response of content type application/json; charset=utf-8; api-version=6.0
2021-01-26T09:24:13.3977501Z VERBOSE: [fv-az124-319]:                            [[AzDevOpsProject]Integration_Test_EnsureProjectPresent] GET 
2021-01-26T09:24:13.3978259Z https://dev.azure.com/azuredevopsdsc/_apis/operations/8b09a49e-8e81-44fb-909f-85dcf9f9340e?includeCapabilities=true&api
2021-01-26T09:24:13.3978748Z -version=6.0 with 0-byte payload
2021-01-26T09:24:13.5620819Z VERBOSE: [fv-az124-319]:                            [[AzDevOpsProject]Integration_Test_EnsureProjectPresent] received 
2021-01-26T09:24:13.5621854Z 286-byte response of content type application/json; charset=utf-8; api-version=6.0
2021-01-26T09:24:14.0693079Z VERBOSE: [fv-az124-319]:                            [[AzDevOpsProject]Integration_Test_EnsureProjectPresent] GET 
2021-01-26T09:24:14.0693805Z https://dev.azure.com/azuredevopsdsc/_apis/operations/8b09a49e-8e81-44fb-909f-85dcf9f9340e?includeCapabilities=true&api
2021-01-26T09:24:14.0694213Z -version=6.0 with 0-byte payload
2021-01-26T09:24:14.2359163Z VERBOSE: [fv-az124-319]:                            [[AzDevOpsProject]Integration_Test_EnsureProjectPresent] received 
2021-01-26T09:24:14.2360155Z 286-byte response of content type application/json; charset=utf-8; api-version=6.0
2021-01-26T09:24:14.7504652Z VERBOSE: [fv-az124-319]:                            [[AzDevOpsProject]Integration_Test_EnsureProjectPresent] GET 
2021-01-26T09:24:14.7505720Z https://dev.azure.com/azuredevopsdsc/_apis/operations/8b09a49e-8e81-44fb-909f-85dcf9f9340e?includeCapabilities=true&api
2021-01-26T09:24:14.7506148Z -version=6.0 with 0-byte payload
2021-01-26T09:24:14.9450210Z VERBOSE: [fv-az124-319]:                            [[AzDevOpsProject]Integration_Test_EnsureProjectPresent] received 
2021-01-26T09:24:14.9453202Z 286-byte response of content type application/json; charset=utf-8; api-version=6.0
2021-01-26T09:24:15.4546631Z VERBOSE: [fv-az124-319]:                            [[AzDevOpsProject]Integration_Test_EnsureProjectPresent] GET 
2021-01-26T09:24:15.4547720Z https://dev.azure.com/azuredevopsdsc/_apis/operations/8b09a49e-8e81-44fb-909f-85dcf9f9340e?includeCapabilities=true&api
2021-01-26T09:24:15.4548385Z -version=6.0 with 0-byte payload
2021-01-26T09:24:15.6217384Z VERBOSE: [fv-az124-319]:                            [[AzDevOpsProject]Integration_Test_EnsureProjectPresent] received 
2021-01-26T09:24:15.6219032Z 286-byte response of content type application/json; charset=utf-8; api-version=6.0
2021-01-26T09:24:16.1587637Z VERBOSE: [fv-az124-319]:                            [[AzDevOpsProject]Integration_Test_EnsureProjectPresent] GET 
2021-01-26T09:24:16.1589535Z https://dev.azure.com/azuredevopsdsc/_apis/operations/8b09a49e-8e81-44fb-909f-85dcf9f9340e?includeCapabilities=true&api
2021-01-26T09:24:16.1590616Z -version=6.0 with 0-byte payload
2021-01-26T09:24:16.3318841Z VERBOSE: [fv-az124-319]:                            [[AzDevOpsProject]Integration_Test_EnsureProjectPresent] received 
2021-01-26T09:24:16.3319997Z 286-byte response of content type application/json; charset=utf-8; api-version=6.0
2021-01-26T09:24:16.8448676Z VERBOSE: [fv-az124-319]:                            [[AzDevOpsProject]Integration_Test_EnsureProjectPresent] GET 
2021-01-26T09:24:16.8449419Z https://dev.azure.com/azuredevopsdsc/_apis/operations/8b09a49e-8e81-44fb-909f-85dcf9f9340e?includeCapabilities=true&api
2021-01-26T09:24:16.8449835Z -version=6.0 with 0-byte payload
2021-01-26T09:24:17.0064792Z VERBOSE: [fv-az124-319]:                            [[AzDevOpsProject]Integration_Test_EnsureProjectPresent] received 
2021-01-26T09:24:17.0066793Z 286-byte response of content type application/json; charset=utf-8; api-version=6.0
2021-01-26T09:24:17.5143439Z VERBOSE: [fv-az124-319]:                            [[AzDevOpsProject]Integration_Test_EnsureProjectPresent] GET 
2021-01-26T09:24:17.5144562Z https://dev.azure.com/azuredevopsdsc/_apis/operations/8b09a49e-8e81-44fb-909f-85dcf9f9340e?includeCapabilities=true&api
2021-01-26T09:24:17.5145245Z -version=6.0 with 0-byte payload
2021-01-26T09:24:17.7117855Z VERBOSE: [fv-az124-319]:                            [[AzDevOpsProject]Integration_Test_EnsureProjectPresent] received 
2021-01-26T09:24:17.7119727Z 286-byte response of content type application/json; charset=utf-8; api-version=6.0
2021-01-26T09:24:18.2212789Z VERBOSE: [fv-az124-319]:                            [[AzDevOpsProject]Integration_Test_EnsureProjectPresent] GET 
2021-01-26T09:24:18.2213825Z https://dev.azure.com/azuredevopsdsc/_apis/operations/8b09a49e-8e81-44fb-909f-85dcf9f9340e?includeCapabilities=true&api
2021-01-26T09:24:18.2214270Z -version=6.0 with 0-byte payload
2021-01-26T09:24:18.3858685Z VERBOSE: [fv-az124-319]:                            [[AzDevOpsProject]Integration_Test_EnsureProjectPresent] received 
2021-01-26T09:24:18.3860536Z 286-byte response of content type application/json; charset=utf-8; api-version=6.0
2021-01-26T09:24:18.8950177Z VERBOSE: [fv-az124-319]:                            [[AzDevOpsProject]Integration_Test_EnsureProjectPresent] GET 
2021-01-26T09:24:18.8950983Z https://dev.azure.com/azuredevopsdsc/_apis/operations/8b09a49e-8e81-44fb-909f-85dcf9f9340e?includeCapabilities=true&api
2021-01-26T09:24:18.8951388Z -version=6.0 with 0-byte payload
2021-01-26T09:24:19.0574961Z VERBOSE: [fv-az124-319]:                            [[AzDevOpsProject]Integration_Test_EnsureProjectPresent] received 
2021-01-26T09:24:19.0575936Z 286-byte response of content type application/json; charset=utf-8; api-version=6.0
2021-01-26T09:24:19.5658928Z VERBOSE: [fv-az124-319]:                            [[AzDevOpsProject]Integration_Test_EnsureProjectPresent] GET 
2021-01-26T09:24:19.5659935Z https://dev.azure.com/azuredevopsdsc/_apis/operations/8b09a49e-8e81-44fb-909f-85dcf9f9340e?includeCapabilities=true&api
2021-01-26T09:24:19.5660615Z -version=6.0 with 0-byte payload
2021-01-26T09:24:19.7280732Z VERBOSE: [fv-az124-319]:                            [[AzDevOpsProject]Integration_Test_EnsureProjectPresent] received 
2021-01-26T09:24:19.7281803Z 286-byte response of content type application/json; charset=utf-8; api-version=6.0
2021-01-26T09:24:20.2405988Z VERBOSE: [fv-az124-319]:                            [[AzDevOpsProject]Integration_Test_EnsureProjectPresent] GET 
2021-01-26T09:24:20.2406724Z https://dev.azure.com/azuredevopsdsc/_apis/operations/8b09a49e-8e81-44fb-909f-85dcf9f9340e?includeCapabilities=true&api
2021-01-26T09:24:20.2407137Z -version=6.0 with 0-byte payload
2021-01-26T09:24:20.4021478Z VERBOSE: [fv-az124-319]:                            [[AzDevOpsProject]Integration_Test_EnsureProjectPresent] received 
2021-01-26T09:24:20.4022704Z 286-byte response of content type application/json; charset=utf-8; api-version=6.0
2021-01-26T09:24:20.9108316Z VERBOSE: [fv-az124-319]:                            [[AzDevOpsProject]Integration_Test_EnsureProjectPresent] GET 
2021-01-26T09:24:20.9109192Z https://dev.azure.com/azuredevopsdsc/_apis/operations/8b09a49e-8e81-44fb-909f-85dcf9f9340e?includeCapabilities=true&api
2021-01-26T09:24:20.9109797Z -version=6.0 with 0-byte payload
2021-01-26T09:24:21.0728697Z VERBOSE: [fv-az124-319]:                            [[AzDevOpsProject]Integration_Test_EnsureProjectPresent] received 
2021-01-26T09:24:21.0729332Z 286-byte response of content type application/json; charset=utf-8; api-version=6.0
2021-01-26T09:24:21.6286853Z VERBOSE: [fv-az124-319]: LCM:  [ End    Set      ]  [[AzDevOpsProject]Integration_Test_EnsureProjectPresent]  in 
2021-01-26T09:24:21.6288895Z 10.9000 seconds.
2021-01-26T09:24:21.6909955Z       [-] Should not throw when compiling MOF and when calling "Start-DscConfiguration" 11.32s
2021-01-26T09:24:21.7420286Z         Expected no exception to be thrown, but an exception "PowerShell DSC resource AzureDevOpsDsc  failed to execute Set functionality with error message: System.InvalidOperationException: The 'Wait-AzDevOpsOperation' function (using OperationId of '8b09a49e-8e81-44fb-909f-85dcf9f9340e') exceeded specified, maximum timeout (10000 milliseconds). (AZDEVOPSCOMMON0702) " was thrown from D:\a\1\s\tests\Integration\DSCClassResources\AzDevOpsProject.Integration.Tests.ps1:514 char:21
2021-01-26T09:24:21.7427696Z             + ...               Start-DscConfiguration @startDscConfigurationParameters
2021-01-26T09:24:21.7436375Z             +                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.
2021-01-26T09:24:21.7444180Z         515:                 } | Should -Not -Throw
2021-01-26T09:24:21.7451784Z         at <ScriptBlock>, D:\a\1\s\tests\Integration\DSCClassResources\AzDevOpsProject.Integration.Tests.ps1: line 495
2021-01-26T09:24:21.7548755Z VERBOSE: An LCM method call arrived from computer fv-az124-319 with user sid 
2021-01-26T09:24:21.7560628Z S-1-5-21-4017747932-1028059775-3929666197-500.
2021-01-26T09:24:21.7599777Z WARNING: [fv-az124-319]:                            [] The GET operation will be carried against a pending 
2021-01-26T09:24:21.7600601Z configuration since the latest configuration has not converged yet.
2021-01-26T09:24:21.8167250Z VERBOSE: [fv-az124-319]: LCM:  [ Start  Get      ]      
2021-01-26T09:24:21.8427710Z VERBOSE: [fv-az124-319]:                            [[AzDevOpsProject]Integration_Test_EnsureProjectPresent] GET 
2021-01-26T09:24:21.8429311Z https://dev.azure.com/azuredevopsdsc/_apis/projects?includeCapabilities=true&api-version=6.0 with 0-byte payload
2021-01-26T09:24:22.0400724Z VERBOSE: [fv-az124-319]:                            [[AzDevOpsProject]Integration_Test_EnsureProjectPresent] received 
2021-01-26T09:24:22.0402029Z 331-byte response of content type application/json; charset=utf-8; api-version=6.0
2021-01-26T09:24:22.0482471Z VERBOSE: [fv-az124-319]:                            [[AzDevOpsProject]Integration_Test_EnsureProjectPresent] GET 
2021-01-26T09:24:22.0483281Z https://dev.azure.com/azuredevopsdsc/_apis/projects/1285b03d-5429-4c14-9804-d5c768742a7b?includeCapabilities=true&api-v
2021-01-26T09:24:22.0484089Z ersion=6.0 with 0-byte payload
2021-01-26T09:24:22.2389956Z VERBOSE: [fv-az124-319]:                            [[AzDevOpsProject]Integration_Test_EnsureProjectPresent] received 
2021-01-26T09:24:22.2393058Z 1053-byte response of content type application/json; charset=utf-8; api-version=6.0
2021-01-26T09:24:22.2483525Z VERBOSE: [fv-az124-319]: LCM:  [ End    Get      ]  [[AzDevOpsProject]Integration_Test_EnsureProjectPresent]  in 0.4310
2021-01-26T09:24:22.2484422Z  seconds.
2021-01-26T09:24:22.2519080Z VERBOSE: [fv-az124-319]: LCM:  [ End    Get      ]    in  0.4890 seconds.
2021-01-26T09:24:22.2845026Z       [+] Should not throw when calling "Get-DscConfiguration" 533ms
2021-01-26T09:24:22.6012195Z       [+] Should have set the resource and all the parameters should match 8ms
2021-01-26T09:24:22.6841121Z VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = TestConfiguration,'className' 
2021-01-26T09:24:22.6845278Z = MSFT_DSCLocalConfigurationManager,'namespaceName' = root/Microsoft/Windows/DesiredStateConfiguration'.
2021-01-26T09:24:22.6852430Z VERBOSE: An LCM method call arrived from computer fv-az124-319 with user sid 
2021-01-26T09:24:22.6854156Z S-1-5-21-4017747932-1028059775-3929666197-500.
2021-01-26T09:24:22.6859567Z VERBOSE: [fv-az124-319]: LCM:  [ Start  Test     ]
2021-01-26T09:24:22.6866653Z WARNING: [fv-az124-319]:                            [] The TEST operation will be carried against a pending 
2021-01-26T09:24:22.6868448Z configuration since the latest configuration has not converged yet.
2021-01-26T09:24:22.6957447Z VERBOSE: [fv-az124-319]: LCM:  [ Start  Resource ]  [[AzDevOpsProject]Integration_Test_EnsureProjectPresent]
2021-01-26T09:24:22.6962363Z VERBOSE: [fv-az124-319]: LCM:  [ Start  Test     ]  [[AzDevOpsProject]Integration_Test_EnsureProjectPresent]
2021-01-26T09:24:22.6966556Z VERBOSE: [fv-az124-319]:                            [[AzDevOpsProject]Integration_Test_EnsureProjectPresent] GET 
2021-01-26T09:24:22.6968823Z https://dev.azure.com/azuredevopsdsc/_apis/projects?includeCapabilities=true&api-version=6.0 with 0-byte payload
2021-01-26T09:24:22.8446063Z VERBOSE: [fv-az124-319]:                            [[AzDevOpsProject]Integration_Test_EnsureProjectPresent] received 
2021-01-26T09:24:22.8447094Z 331-byte response of content type application/json; charset=utf-8; api-version=6.0
2021-01-26T09:24:22.8509627Z VERBOSE: [fv-az124-319]:                            [[AzDevOpsProject]Integration_Test_EnsureProjectPresent] GET 
2021-01-26T09:24:22.8511334Z https://dev.azure.com/azuredevopsdsc/_apis/projects/1285b03d-5429-4c14-9804-d5c768742a7b?includeCapabilities=true&api-v
2021-01-26T09:24:22.8511718Z ersion=6.0 with 0-byte payload
2021-01-26T09:24:23.0188657Z VERBOSE: [fv-az124-319]:                            [[AzDevOpsProject]Integration_Test_EnsureProjectPresent] received 
2021-01-26T09:24:23.0189649Z 1053-byte response of content type application/json; charset=utf-8; api-version=6.0
2021-01-26T09:24:23.0296472Z VERBOSE: [fv-az124-319]: LCM:  [ End    Test     ]  [[AzDevOpsProject]Integration_Test_EnsureProjectPresent] True in 
2021-01-26T09:24:23.0298306Z 0.3610 seconds.
2021-01-26T09:24:23.0300575Z VERBOSE: [fv-az124-319]: LCM:  [ End    Resource ]  [[AzDevOpsProject]Integration_Test_EnsureProjectPresent]
2021-01-26T09:24:23.0305246Z VERBOSE: [fv-az124-319]: LCM:  [ End    Test     ]     Completed processing test operation. The operation returned 
2021-01-26T09:24:23.0305868Z True.
2021-01-26T09:24:23.0314061Z VERBOSE: [fv-az124-319]: LCM:  [ End    Test     ]    in  0.4180 seconds.
2021-01-26T09:24:23.0606179Z VERBOSE: Operation 'Invoke CimMethod' complete.
2021-01-26T09:24:23.0612577Z VERBOSE: Time taken for configuration job to complete is 0.459 seconds
2021-01-26T09:24:23.0698400Z       [+] Should return $true when Test-DscConfiguration is run 463ms
2021-01-26T09:24:23.1010658Z 

Suggested solution to the issue

The DSC configuration that is used to reproduce the issue (as detailed as possible)

From the integration tests, the configuration AzDevOpsProject_EnsureProjectPresent_Config

AzDevOpsProject Integration_Test_EnsureProjectPresent
{
    ApiUri              = $Node.ApiUri
    Pat                 = $Node.Pat
    ProjectName         = $Node.ProjectName
    ProjectDescription  = $Node.ProjectDescription
    SourceControlType   = $Node.SourceControlType
    Ensure              = $Node.Ensure
}

Azure DevOps Server version the target node is running

Azure DevOps Services

VSTeam PowerShell modules present on the target node

Not applicable

The operating system the target node is running

Microosft Hosted Agent (Azure Pipelines) running the integration tests.

Version and build of PowerShell the target node is running

Not applicable

Version of the DSC module that was used

Latest main

@johlju johlju added bug The issue is a bug. tests The issue or pull request is about tests only. labels Jan 26, 2021
@SphenicPaul
Copy link
Contributor

The actions performed by the AzureDevOps API are asynchronous so the request (e.g POST or PUT) is made and you have to repeatedly request (GET) an updated operation to determine once AzureDevOps has completed it.

The timeout I added (to prevent endless looping/waiting) may need it’s value increasing. AzureDevOps may be “busy” and taking a while to queue and perform the operations.

I’ll try and take a look later today.

@johlju
Copy link
Member Author

johlju commented Jan 26, 2021

I see! I think would be good if such timeout values can be set by the user in the configuration (but could have a default value).

@SphenicPaul
Copy link
Contributor

I agree it would be useful for the user to set and/or override, although it seems a little "painful" if we have to pass this into every resource - There are other options like this (e.g. the version of the API used) which is hardcoded at present, and I suspect there will be more.

What about options for using environment variables in which to set/overide these without having to setup as resource properties? .. these would be more specific to overiding the way the resources were applied rather than the state of the resources? ... not sure what thoughts you have on this? Is this easily possible?

Also, if you've now been able to merge the PR ( #20 ), I'll likely leave this issue for now and I'll try and take a look at a few of the issues (including this one) when I get a block of time (might be at the weekend or into next week).

I'll try and get a few "quick wins" and tidy-ups into a PR, and then I might start looking at getting integration tests running in PRs - some of that will get most of the way towards another, initial resource (e.g. AzDevOpsServer or AzDevOpsServerSetup) and I suspect some of the functionality will already be present within the SqlServerDsc module, integration tests for setting up the SQL instance.

Finally, I'd still like to have a little look at setting up the resource to use one of the modules suggested by @kilasuit in the initial PR ( #7 ) to see what's involved and what could/might need to be changed (and it might remove requirement for some of the future changes).

@johlju
Copy link
Member Author

johlju commented Jan 27, 2021

Added issue #27 to track the potential usage of the suggested dependent modules.

@johlju
Copy link
Member Author

johlju commented Jan 27, 2021

I merged #20 so we can pick this up when we have time. Sometimes the tests must be manually kicked if they fail until this is resolved. 🙂

What about options for using environment variables in which to set/overide these without having to setup as resource properties? .. these would be more specific to overiding the way the resources were applied rather than the state of the resources? ... not sure what thoughts you have on this? Is this easily possible?

I see your point to have this in every resource. Since one normally wouldn't want one resource to have one timeout value and another a different timeout value it makes sense if it possible to get those values in another way.

Then we need to have a new resource, or composite resource that is using Script resource, that can be used to sets environment variables in the session prior to running this modules resources. Maybe this must be machine-wide environment variables, maybe it is not possible to assume it works with session environment variables, thinking of Invoke-DscResource in PowerShell 7.1 and above. The way we configure this should also work cross-platform so we can run Invoke-DscResource in the next version of PowerShell (7.2 or whatever version will better support cross-platform).

SphenicPaul added a commit to SphenicPaul/AzureDevOpsDsc that referenced this issue Jan 28, 2021
johlju pushed a commit that referenced this issue Jan 29, 2021
…es (#28)

- AzureDevOpsDsc
    - Increased Azure DevOps, API timeout to 5 minutes to allow for busy/slow API
      operations (issue #25).
    - Updated contextual help (issue #5).
    - Removed `Classes` directory from being output in packaged module (issue #10).
    - Removed `Examples` directory from being output in packaged module (issue #11).
    - Moved 'Ensure' and 'RequiredAction' enums into 'Enum' directory and out of
      'prefix.ps1' (issue #12).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug. tests The issue or pull request is about tests only.
Projects
None yet
2 participants