tag:help.appveyor.com,2012-11-13:/discussions/problems/16354-nullreferenceexception-thrown-by-test-logger-during-buildAppVeyor: Discussion 2019-06-27T05:24:11Ztag:help.appveyor.com,2012-11-13:Comment/460120182018-09-02T14:35:25Z2018-09-02T14:35:25ZNullReferenceException thrown by test logger during build<div><p>A NullReferenceException is occurring in a build of a project of mine when AppVeyor tries to upload the xunit test results:</p>
<p><a href="https://ci.appveyor.com/project/martincostello/alexa-london-travel-site/build/2.1.556#L248">https://ci.appveyor.com/project/martincostello/alexa-london-travel-...</a></p>
<p>This was causing the builds to fail until I changed the Powershell settings for my build script to ignore it.</p>
<p>AppVeyor should be correctly uploading the test results and not throwing an exception.</p></div>martin.costello1tag:help.appveyor.com,2012-11-13:Comment/460120182018-09-13T16:31:14Z2018-09-13T16:31:14ZNullReferenceException thrown by test logger during build<div><p>This is also happening with a different project: <a href="https://ci.appveyor.com/project/martincostello/website/build/2.1.498">https://ci.appveyor.com/project/martincostello/website/build/2.1.498</a></p></div>martin.costello1tag:help.appveyor.com,2012-11-13:Comment/460120182018-09-13T20:38:05Z2018-09-13T20:38:05ZNullReferenceException thrown by test logger during build<div><p>Sorry for the delay in responding. We have been trying to determine the cause of this error but haven't finished investigating. We haven't forgot.<br>
The additional project should be helpful in the investigation, thanks for that.</p></div>Owen McDonnelltag:help.appveyor.com,2012-11-13:Comment/460120182018-09-20T17:04:08Z2018-09-20T17:04:08ZNullReferenceException thrown by test logger during build<div><p>Can you try adding <code>"parallelizeTestCollections": false</code> to your <code>xunit.runner.json</code> file.</p></div>Owen McDonnelltag:help.appveyor.com,2012-11-13:Comment/460120182018-09-22T15:09:01Z2018-09-22T15:09:01ZNullReferenceException thrown by test logger during build<div><p>I've changed this setting (<a href="https://github.com/martincostello/alexa-london-travel-site/pull/222/commits/011d02625858e104dfc7009030e6f36f9419c1e7">https://github.com/martincostello/alexa-london-travel-site/pull/222...</a>). As it's intermittent, several builds over time will need to happen to see if that's the setting that's breaking things.</p></div>martin.costello1tag:help.appveyor.com,2012-11-13:Comment/460120182018-09-22T17:57:42Z2018-09-22T17:57:42ZNullReferenceException thrown by test logger during build<div><p>That did not fix it: <a href="https://ci.appveyor.com/project/martincostello/alexa-london-travel-site/build/2.1.587#L277">https://ci.appveyor.com/project/martincostello/alexa-london-travel-...</a></p></div>martin.costello1tag:help.appveyor.com,2012-11-13:Comment/460120182018-09-22T22:05:11Z2018-09-22T22:05:11ZNullReferenceException thrown by test logger during build<div><p>I added another setting <code>"maxParallelThreads": 1</code> to that same file and had several (over 10) successful runs starting <a href="https://ci.appveyor.com/project/britzkopf/alexa-london-travel-site/build/2.1.117">here</a>.</p>
<p>The <a href="https://ci.appveyor.com/project/britzkopf/alexa-london-travel-site/build/2.1.122">one build error</a> i did eventually get happens before the <strong>Testing</strong> function is even called in your Build.ps1, and seems to be an unrelated problem.</p></div>Owen McDonnelltag:help.appveyor.com,2012-11-13:Comment/460120182018-09-23T07:45:37Z2018-09-23T07:45:37ZNullReferenceException thrown by test logger during build<div><p>Setting that has also not fixed it.</p>
<p>Commit: <a href="https://github.com/martincostello/alexa-london-travel-site/pull/224/commits/dc94531f6d41a4333fa8b2cb5b48bed7f1583bdb">https://github.com/martincostello/alexa-london-travel-site/pull/224...</a><br>
Build of a later commit: <a href="https://ci.appveyor.com/project/martincostello/alexa-london-travel-site/build/2.1.597#L277">https://ci.appveyor.com/project/martincostello/alexa-london-travel-...</a></p></div>martin.costello1tag:help.appveyor.com,2012-11-13:Comment/460120182018-09-23T07:48:56Z2018-09-23T07:48:56ZNullReferenceException thrown by test logger during build<div><p>Looks like this is coming from within xunit's built-in AppVeyor reporter: <a href="https://github.com/xunit/xunit/blob/9d10262a3694bb099ddd783d735aba2a7aac759d/src/xunit.runner.reporters/AppVeyorClient.cs#L122">https://github.com/xunit/xunit/blob/9d10262a3694bb099ddd783d735aba2...</a></p></div>martin.costello1tag:help.appveyor.com,2012-11-13:Comment/460120182018-09-23T08:09:40Z2018-09-23T08:09:40ZNullReferenceException thrown by test logger during build<div><p>Have logged an issue with xunit here: <a href="https://github.com/xunit/xunit/issues/1821">https://github.com/xunit/xunit/issues/1821</a></p></div>martin.costello1tag:help.appveyor.com,2012-11-13:Comment/460120182018-09-23T13:52:51Z2018-09-23T13:52:51ZNullReferenceException thrown by test logger during build<div><p>After further investigation, root cause appears to be Application Insights: <a href="https://github.com/Microsoft/ApplicationInsights-dotnet-server/pull/1006">https://github.com/Microsoft/ApplicationInsights-dotnet-server/pull...</a></p></div>martin.costello1tag:help.appveyor.com,2012-11-13:Comment/460120182018-09-24T16:41:15Z2018-09-24T16:41:15ZNullReferenceException thrown by test logger during build<div><p>Can you take a look at my <a href="https://ci.appveyor.com/project/britzkopf/alexa-london-travel-site/history">build history</a> and explain to me why every build of <a href="https://github.com/OwenMcDonnell/alexa-london-travel-site/commit/ac2cf0d279dd6f5379010b7e10589bef9daab045">this commit</a> fails with the original error for which this thread was created, while <a href="https://github.com/OwenMcDonnell/alexa-london-travel-site/commit/ea06b3b1e42844c8cc91f2637b2159d355d829c0">this commit</a>, with the suggested changes, succeds.</p></div>Owen McDonnelltag:help.appveyor.com,2012-11-13:Comment/460120182018-09-24T16:52:52Z2018-09-24T16:52:52ZNullReferenceException thrown by test logger during build<div><p>Changing those settings certainly seem to make it less likely to fail, but they don’t resolve the problem completely as I still had occasional failure after changing the settings.</p>
<p>It seems like there’s an threading issue in Application Insights which causes something to be null, which then causes a NullRefenceException due to null not being checked for, which can then break HTTP calls made in the application. This also appears to be the likely cause of random errors I’m having with Selenium WebDriver.</p></div>martin.costello1