GitHub actions tests failing with decimals in .net core 3.1 but works locally

I am using .net core 3.1.3 c# on windows.

As you can see the action is failing as some tests are failing in my branch show-elapsed-time

The problem is those tests pass locally on my machine.

I want to say it’s an issue with rounding but I’m not sure there’s a huge number jump by a whole number. Also it is expecting the letter d here where locally it fails with the d.

I’ve change the config file a few times now as you can see in the branch show-elapsed-time but to no avail.
(I tried to add the second screenshot but since I am a new support user I couldn’t add it).

@jhnsartain3,

I forked you repository and tested on my side, I can reproduce the same errors.

I noticed that you mentioned the dotnet test for your project can work on your local machine.

The problem is those tests pass locally on my machine.

I also tested your project on my local machine, but I still get the same errors as that in the workflow run.

You can see they returned the almost same errors.
Please check again on your local machine, and make sure there are not defects in the config file for the tests of your project.

If the dotnet test for your project indeed works fine on your local machine, please try installing a self-hosted runner on the local machine, then run the workflow on this self-hosted runner to see if the errors still occur.

1 Like

It’s very worrisome that you also got the errors and I didn’t.

Things I tried to resolve:
modify the test to be more lenient
check the tests .csproj file, play around with different configurations
delete the tests library, recreating
reinstall .net core sdk
reinstall visual studio 2019
run dotnet test on my local
run dotnet test on my server
reinstall windows on local
reinstall .net core sdk on local and server
retry tests on server/local

They still pass. I have never been so frustrated with my tests passing.

Please note I have merged to master.

Could you give me an example of a self hosted runner? I am not sure what you mean.

Also just to keep you up to date. I have extracted these code set and tests to a nuget package so that my tests will stop failing on my project.

@jhnsartain3,

You can reference the docs about “Adding self-hosted runners” to add a self-hosted runner on your local machine.
And reference the docs about “Using self-hosted runners in a workflow” to try using the self-hosted runner in your workflow.

To view more details about self-hosted runner, you can see here:
https://help.github.com/en/actions/hosting-your-own-runners