ttu / dotnet-fake-json-server

Fake JSON Server is a Fake REST API that can be used as a Back End for prototyping or as a template for a CRUD Back End.
https://ttu.github.io/dotnet-fake-json-server/
MIT License
388 stars 84 forks source link

Travis CI test (Linux) fail with "System.IO.IOException: The configured user limit (128) on the number of inotify instances has been reached ..." #98

Open ttu opened 2 years ago

ttu commented 2 years ago

Unit tests on Travis (Linux) fail with

System.IO.IOException : The configured user limit (128) on the number of inotify instances has been reached, or the per-process limit on the number of open file descriptors has been reached.

Example failing test run: https://app.travis-ci.com/github/ttu/dotnet-fake-json-server/builds/251835568

Example stack trace:

[xUnit.net 00:02:53.56]     FakeServer.Test.Authentication.TokenAuthenticationSpecs.GetToken_InvalidJsonData [FAIL]
  Failed FakeServer.Test.Authentication.TokenAuthenticationSpecs.GetUsers_Authorized_Logout(tokenType: Json) [1 ms]
  Error Message:
   System.IO.IOException : The configured user limit (128) on the number of inotify instances has been reached, or the per-process limit on the number of open file descriptors has been reached.
  Stack Trace:
     at System.IO.FileSystemWatcher.StartRaisingEvents()
   at Microsoft.Extensions.FileProviders.Physical.PhysicalFilesWatcher.TryEnableFileSystemWatcher()
   at Microsoft.Extensions.FileProviders.Physical.PhysicalFilesWatcher.CreateFileChangeToken(String filter)
   at Microsoft.Extensions.Primitives.ChangeToken.OnChange(Func`1 changeTokenProducer, Action changeTokenConsumer)
   at Microsoft.Extensions.Configuration.FileConfigurationProvider..ctor(FileConfigurationSource source)
   at Microsoft.Extensions.Configuration.Json.JsonConfigurationSource.Build(IConfigurationBuilder builder)
   at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build()
   at Microsoft.AspNetCore.Hosting.WebHostBuilder.BuildCommonServices(AggregateException& hostingStartupErrors)
   at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()
   at Microsoft.AspNetCore.TestHost.TestServer..ctor(IWebHostBuilder builder, IFeatureCollection featureCollection)
   at Microsoft.AspNetCore.Mvc.Testing.WebApplicationFactory`1.CreateServer(IWebHostBuilder builder)
   at Microsoft.AspNetCore.Mvc.Testing.WebApplicationFactory`1.EnsureServer()
   at Microsoft.AspNetCore.Mvc.Testing.WebApplicationFactory`1.CreateDefaultClient(DelegatingHandler[] handlers)
   at Microsoft.AspNetCore.Mvc.Testing.WebApplicationFactory`1.CreateClient(WebApplicationFactoryClientOptions options)
   at FakeServer.Test.IntegrationFixture.StartServer(String authenticationType) in /home/travis/build/ttu/dotnet-fake-json-server/FakeServer.Test/IntegrationTestCollection.cs:line 69
   at FakeServer.Test.Authentication.TokenAuthenticationSpecs..ctor(IntegrationFixture fixture) in /home/travis/build/ttu/dotnet-fake-json-server/FakeServer.Test/Authentication/TokenAuthenticationSpecs.cs:line 24