The link in accepted answer is not working, so I am adding my solution of the problem.
Using xUnit 2.8.1 and visual studio runner.
When I tried to disable parallelization in xunit.runner.json, it did not work. Neither with just
"parallelizeTestCollections": false
nor when adding
"maxParallelThreads": 1
my solution was to use the assembly attribute
[assembly: CollectionBehavior(MaxParallelThreads = 1, DisableTestParallelization = true)]