.NET tests silently exiting on Ubuntu2204

Rob's Avatar

Rob

01 Apr, 2024 11:52 AM

Our test runs are sporadically only running about 830-840 tests from ~2950 and then returning with exit code 0, and reporting the job as successful on Ubuntu2204.

Examples

https://ci.appveyor.com/project/drieseng/ssh-net/builds/49520209 (bad)
https://ci.appveyor.com/project/drieseng/ssh-net/builds/49519909 (good)
https://ci.appveyor.com/project/drieseng/ssh-net/builds/49517420 (bad)
https://ci.appveyor.com/project/drieseng/ssh-net/builds/49517362 (bad, this one actually crashed)
https://ci.appveyor.com/project/drieseng/ssh-net/builds/49517250 (bad)
https://ci.appveyor.com/project/drieseng/ssh-net/builds/49517209 (good)

It seems to go back a couple of weeks. It may coincide with a change where we dropped the use of .NET SDK version 8.0.100 from apt-get in favour of the pre-loaded .NET 8 SDK (8.0.200) on the Ubuntu2204 image. However, the problem still exists when reinstating the apt-get for 8.0.203 (see also https://github.com/sshnet/SSH.NET/pull/1367)

Adding --verbosity to the dotnet test command shows no further detail other than "Build exited with code 0"

  1. 1 Posted by Rob on 01 Apr, 2024 11:55 AM

    Rob's Avatar

    The apt-get change from a few weeks ago was https://github.com/sshnet/SSH.NET/pull/1352

  2. Support Staff 2 Posted by Owen McDonnell on 02 Apr, 2024 04:39 PM

    Owen McDonnell's Avatar

    Current pre-installed version of .NET 8 on Ubuntu build images is 8.0.200-1. What happens if you skip the apt-get install?

  3. 3 Posted by Rob Hague on 02 Apr, 2024 05:57 PM

    Rob Hague's Avatar

    Apologies, I have found some much earlier examples than the SDK changes.

    The earliest I've found so far is
    https://ci.appveyor.com/project/drieseng/ssh-net/builds/49212813

    Similarly, 840ish tests and then exit code 0 and job "successful"

  4. 4 Posted by Rob on 05 Apr, 2024 02:56 PM

    Rob's Avatar

    Update: I have narrowed it down to some very (unnecessarily) large arrays being allocated in the test code. After removing these, the jobs are stable.

    Presumably then, the process was crashing due to out-of-memory. But I cannot imagine why it had exit code 0?

  5. Support Staff 5 Posted by Owen McDonnell on 06 Apr, 2024 04:06 AM

    Owen McDonnell's Avatar

    It's likely the way that the build agent's custom powershell host is treating the error.
    You could put the test section into a powershell script (test_sript.ps1) with $ErrorActionPreference = "Stop" at the beginning of that script and call that from the testing section of your config and you should get a more predictable exit code.

  6. Feodor Fitsner closed this discussion on 06 Jun, 2024 09:03 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

 

26 Sep, 2024 03:49 PM
26 Sep, 2024 09:02 AM
25 Sep, 2024 07:07 PM
24 Sep, 2024 08:39 PM
24 Sep, 2024 06:47 AM
20 Sep, 2024 05:50 PM