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

error TF298509 when running in Azure DevOps: #4760

Open
apobekiaris opened this issue Nov 22, 2023 · 5 comments
Open

error TF298509 when running in Azure DevOps: #4760

apobekiaris opened this issue Nov 22, 2023 · 5 comments
Assignees

Comments

@apobekiaris
Copy link

apobekiaris commented Nov 22, 2023

##[error]Data collector 'Screen and Voice Recorder' message: Data collector caught an exception of type 'Microsoft.VisualStudio.TestTools.DataCollection.MediaRecorder.MediaRecorderException': 'Failed to establish communication with the screen recorder process'. More details: TF298509 : An error occurred while starting the screen recorder. Media will not be recorded. Review the log file for more details...

The exception is thrown everytime and on different agents regardless if the build succeeds.

Next is my yml and the used template

jobs:
  - job: ImportData
    displayName: 'ImportData Job'
    timeoutInMinutes: 90
    variables:
      defaultWorkingDir: '$(System.DefaultWorkingDirectory)\CS'
      runSettingsPath: '$(defaultWorkingDir)\Tests\Tests.runsettings'
      testsFolderPath: '$(defaultWorkingDir)\Tests'
      dxFeedVar: '$(DXFeed)'
      NUGET_PACKAGES: $(Pipeline.Workspace)/.nuget/packages
    pool:
      vmImage: 'windows-2022'
    steps:
    - task: PowerShell@2
      displayName: Build
      continueOnError: false
      inputs:
        targetType: 'inline'
        script: |
          & sqllocaldb start mssqllocaldb
          dotnet nuget add source $(dxFeedVar) --name DX
          cd "$(defaultWorkingDir)"
          dotnet build --configuration TEST
          Get-ChildItem -Path "$(testsFolderPath)" -Recurse -Directory -Include "ref", "refint", "obj" | 
          ForEach-Object { Remove-Item $_.FullName -Recurse -Force }  
        pwsh: true      
    - task: VSTest@3
      displayName: 'ImportData.Test'
      continueOnError: false
      enabled: true
      inputs:
        minimumExpectedTests: "1"
        failOnMinTestsNotRun: true
        searchFolder: $(testsFolderPath)
        testSelector: 'testAssemblies'
        testAssemblyVer2: '**\OutlookInspired.Win.Tests.dll'
        testFiltercriteria: TestCategory=ImportData
        diagnosticsEnabled: true
        codeCoverageEnabled: true
        runSettingsFile: $(runSettingsPath)

  - template: job-template.yml
    parameters:
      testAssembly: '**\OutlookInspired.Win.Tests.dll'
      displayName: 'Windows'
  
  - template: job-template.yml
    parameters:
      testAssembly: '**\OutlookInspired.Blazor.Tests.dll'
      displayName: 'Blazor'
parameters:
  testAssembly: ''
  displayName: ''

jobs:
- job: ${{ parameters.displayName }}
  variables:
    defaultWorkingDir: '$(System.DefaultWorkingDirectory)\CS'
    runSettingsPath: '$(defaultWorkingDir)\Tests\Tests.runsettings'
    testsFolderPath: '$(defaultWorkingDir)\Tests'
    dxFeedVar: '$(DXFeed)'
    NUGET_PACKAGES: $(Pipeline.Workspace)/.nuget/packages
  strategy:
    matrix:
      Admin: {}
      Sales: {}
      Support: {}
      Management: {}
      Engineering: {}
      IT: {}
      Shipping: {}
      HumanResources: {}
  timeoutInMinutes: 90
  pool:
    vmImage: 'windows-2022'
  steps:
  - task: PowerShell@2
    displayName: Build
    continueOnError: false
    inputs:
      targetType: 'inline'
      script: |
        Write-Output "${{ parameters.testAssembly }}"
        & sqllocaldb start mssqllocaldb
        dotnet nuget add source $(dxFeedVar) --name DX
        cd "$(defaultWorkingDir)"
        dotnet build --configuration TEST
        Get-ChildItem -Path "$(testsFolderPath)" -Recurse -Directory -Include "ref", "refint", "obj" | 
        ForEach-Object { Remove-Item $_.FullName -Recurse -Force }  
      pwsh: true      
  - task: VSTest@3
    displayName: ${{ parameters.displayName }}
    continueOnError: false
    env:
        TEST_ROLE: $(Agent.JobName)
        BingKey: $(BingKey)
    enabled: true
    inputs:
      minimumExpectedTests: "1"
      failOnMinTestsNotRun: true
      rerunFailedTests: false
      searchFolder: $(testsFolderPath)
      testSelector: 'testAssemblies'
      testAssemblyVer2: ${{ parameters.testAssembly }}
      testFiltercriteria: TestCategory=Tests
      diagnosticsEnabled: true
      codeCoverageEnabled: true
      uiTests: true
      runSettingsFile: $(runSettingsPath)
      otherConsoleOptions: '/Diag:vstestlog.txt'
  - task: CopyFiles@2
    displayName: Copy vstestlog logs to staging
    inputs:
      contents: '**/*vstestlog*.txt'
      targetFolder: $(Build.ArtifactStagingDirectory)/vstestlog
    condition: always()
  - task: PublishPipelineArtifact@1
    displayName: Publish vstestlog log
    inputs:
      targetPath: $(Build.ArtifactStagingDirectory)/vstestlog
      artifactName: vstestlog-$(Agent.JobName)-$(Build.BuildId)
    condition: always()


vstestslog.zip

attaching my logs

@nohwnd
Copy link
Member

nohwnd commented Nov 22, 2023

@cvpoienaru I think screen recorder is your alley. Please have a look.

@cvpoienaru cvpoienaru self-assigned this Nov 22, 2023
@apobekiaris
Copy link
Author

Hello how is this progressing, this is an amazing usefull feature for our integration tests.

@cvpoienaru
Copy link
Member

Hello, thanks for reaching out.

I had a look into the logs you've attached and there's a couple of errors but the one that caught my attention is this one:

TpTrace Error: 0 : 5260, 7, 2023/11/21, 18:49:42.561, 5926854447, datacollector.exe, MediaRecorder.Start Failed : System.ComponentModel.Win32Exception (0x80004005): Error starting recorder: 258

Server stack trace: 
   at Microsoft.VisualStudio.TestTools.VideoRecorder.RecorderEngineWrapper.ThrowIfFailed(Int32 errorCode, String errorFormat) in D:\dbs\sh\ddvsm\0619_100222\cmd\1a\src\vset\QTools\Execution\Agent\Plugins\MediaRecorder\MediaFoundationRecorder\RecorderProcess\RecorderEngineWrapper.cs:line 131
   at Microsoft.VisualStudio.TestTools.VideoRecorder.RecorderEngineWrapper.StartVideoRecorder(UInt32 bitRate, UInt32 frameRate, Boolean recordAudio, Boolean recordVideo, String outputFileName, Action`1 callback) in D:\dbs\sh\ddvsm\0619_100222\cmd\1a\src\vset\QTools\Execution\Agent\Plugins\MediaRecorder\MediaFoundationRecorder\RecorderProcess\RecorderEngineWrapper.cs:line 26
   at Microsoft.VisualStudio.TestTools.VideoRecorder.MediaFoundationRecorder.StartMediaRecorder(Int32 bitRate, Int32 frameRate, Boolean recordAudio, Boolean recordVideo, String outputFileName) in D:\dbs\sh\ddvsm\0619_100222\cmd\1a\src\vset\QTools\Execution\Agent\Plugins\MediaRecorder\MediaFoundationRecorder\RecorderProcess\MediaFoundationRecorder.cs:line 72
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [0]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at Microsoft.VisualStudio.TestTools.DataCollection.MediaRecorder.Model.IMediaRecorder.StartMediaRecorder(Int32 bitRate, Int32 frameRate, Boolean recordAudio, Boolean recordVideo, String outputFileName)
   at Microsoft.VisualStudio.TestTools.DataCollection.MediaRecorder.MediaFoundationRecorder.Start()

Unfortunately it's unclear why this error occurs. The error code 258 means that some sort of timeout has expired waiting for the process to start. There's no insights from the native code that actually starts the process, which brings me to the ask I have:

Can you please create a small repro solution and send it over to us for analysis ? I don't see anything obviously wrong with the pipeline configuration but it is complex and hard to analyze in the context of this issue. A repro solution would be more helpful so I can step inside the native code and get a better feeling of why process spawning fails.

@apobekiaris
Copy link
Author

I do not have a way to reproduce it in a sample repo, it happens occusionally even on self-hosted agents.

he error code 258 means that some sort of timeout has expired waiting for the process to start

I wonder, does it make sense if you can introduce a retry to the operation?

@MarcoRossignoli
Copy link
Contributor

MarcoRossignoli commented Feb 21, 2024

@apobekiaris can you collect the events from the agent and when it will happen again sent do us? If the process fails to start for some reason(crash) we could see it at machine level.

Note: these logs could contain sensitive information (paths, project name...). Make sure to clean them or use the Visual Studio Send Feedback button. Don't put anything you want to keep private in the title or content of the initial report, which is public. Instead, say that you'll send details privately in a separate comment. Once the problem report is created, it's now possible to specify who can see your replies and attachments.

I wonder, does it make sense if you can introduce a retry to the operation?

Before to update the code we prefer understand if it's an isolated case or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants