skip to Main Content

When I run builds on xUnit tests in my VS all my Tests are passing but on pipeline build I get only 1 error and that is due to timeout.

This is code error from DevOps:

Error Message:
2024-07-03T13:46:54.0677410Z System.Exception : Assertions not tested due to timeout

VS Build

VS Build

DevOps error:

DevOps error

Tried Re-queueing build but always same thing, maybe DevOps has different timeout than VS?

this is log downloaded from DevOps:

2024-07-03T13:46:25.7473431Z Starting test execution, please wait...
2024-07-03T13:46:25.9228679Z A total of 1 test files matched the specified pattern.
2024-07-03T13:46:52.8484605Z [xUnit.net 00:00:17.95]     MeltFieldTest.PlantUnitTest.ShouldDetectAndCancelPlantUnitEventMultipleTimes(fieldEventName: "HotMetalCarEmptyFieldEvent", antagonistFieldEventName: "LadleOnHotMetalCarFieldEvent", stateName: "HotMetalCar", initialValue: 2, finalValue: 1, plantUnitEventType: "HotMetalCarEmptyPlantUnitEvent", candidateTime: 1) [FAIL]
2024-07-03T13:46:54.0672440Z   Failed MeltFieldTest.PlantUnitTest.ShouldDetectAndCancelPlantUnitEventMultipleTimes(fieldEventName: "HotMetalCarEmptyFieldEvent", antagonistFieldEventName: "LadleOnHotMetalCarFieldEvent", stateName: "HotMetalCar", initialValue: 2, finalValue: 1, plantUnitEventType: "HotMetalCarEmptyPlantUnitEvent", candidateTime: 1) [2 s]
2024-07-03T13:46:54.0677109Z   Error Message:
2024-07-03T13:46:54.0677410Z    System.Exception : Assertions not tested due to timeout
2024-07-03T13:46:54.0677596Z   Stack Trace:
2024-07-03T13:46:54.0677874Z      at MeltFieldTest.Utils.Poller.CheckUntil(Action[] assertions) in D:a1sMeltFieldMeltFieldTestUtilsPoller.cs:line 28
2024-07-03T13:46:54.0678450Z    at MeltFieldTest.PlantUnitTest.ShouldDetectAndCancelPlantUnitEventMultipleTimes(String fieldEventName, String antagonistFieldEventName, String stateName, Int32 initialValue, Int32 finalValue, String plantUnitEventType, Int32 candidateTime) in D:a1sMeltFieldMeltFieldTestPlantUnitTest.cs:line 171
2024-07-03T13:48:21.9539867Z Results File: D:a_tempVssAdministrator_fv-az285-59_2024-07-03_13_46_50.trx
2024-07-03T13:48:21.9543780Z 
2024-07-03T13:48:21.9592259Z Failed!  - Failed:     1, Passed:   207, Skipped:     0, Total:   208, Duration: 1 m 31 s - MeltFieldTest.dll (net6.0)
2024-07-03T13:48:23.3368206Z Test run for D:a1sMeltProductionMeltProductionTestbinDebugnet6.0MeltProductionTest.dll (.NETCoreApp,Version=v6.0)
2024-07-03T13:48:23.4091901Z Microsoft (R) Test Execution Command Line Tool Version 17.10.0 (x64)
2024-07-03T13:48:23.4121303Z Copyright (c) Microsoft Corporation.  All rights reserved.

2

Answers


  1. Assuming that your test accesses a database it could be:

    • Locally it runs fine since the test has access to the database server.

    • When the test runs on the server, it cannot access the database, so the connection waits for a timeout. Before the database connection times out, the test execution times out.

    Login or Signup to reply.
  2. Double-check if there is a timeout set at the task or job level and adjust it accordingly.

    Example:

    jobs:
      - job: Build
        timeoutInMinutes: 20 # <------------------- job timeout
        steps:
          # other tasks here ...
          - task: DotNetCoreCLI@2
            displayName: Run unit tests
            timeoutInMinutes: 10 # <------------------- task timeout
            inputs:
              command: test
              projects: '**/*Tests/*.csproj'
              arguments: '--configuration $(buildConfiguration)'
    

    See Jobs timeouts for more details regarding default and maximum timeout values.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search