Forum Discussion

DVogler's avatar
DVogler
New Contributor
2 days ago
Solved

Log.Message("String") raises "The object does not exist" on Azure pipeline

We are getting "The object does not exist" when trying to log only for some files and for some tests it only affects them when running as part of a longer run of tests, not when that test is run by itself on the pipeline. So far, all the affected files are ones that do not actually contain tests but are refenced by tests.

BuiltIn.Delay and all the other Log functions are also affected when this happens.

All the tests are written in Python

Is there an import that is needed on files which the tests invoke? 

We never get this error running locally on a dev box, only in Azure pipelines. It is possible the pipeline is running a newer version than the devs are running. Has the syntax for invoking this changed in the last year and a half?

I cannot find anything in the documentation to suggest either of those, and they would not explain why the tests pass when run alone on the pipeline. But built in types not existing is not something I can actually wrap my head around the cause of, so I am sort of guessing randomly.

Some help figuring out what may be happening would be much appreciated.

  • DVogler's avatar
    DVogler
    10 hours ago

    Thank you very much. May do that.

    For now, I have found a workaround: run each test in a different instance of the VSTest task

    - ${{ each test in parameters.tests }}:
      - task: VSTest@3
          testFiltercriteria: Name=${{ test }}
          ...
        condition: always()

    Requires a bit of duplication since you need to add it to both the project and yaml, but comes with a few unexpected benefits as well.

2 Replies

    • DVogler's avatar
      DVogler
      New Contributor

      Thank you very much. May do that.

      For now, I have found a workaround: run each test in a different instance of the VSTest task

      - ${{ each test in parameters.tests }}:
        - task: VSTest@3
            testFiltercriteria: Name=${{ test }}
            ...
          condition: always()

      Requires a bit of duplication since you need to add it to both the project and yaml, but comes with a few unexpected benefits as well.