Skip to content
This repository was archived by the owner on Dec 20, 2018. It is now read-only.

Commit 95bc251

Browse files
committed
Avoid file descriptor exhaustion caused by Razor Pages on functional tests
1 parent 168be7b commit 95bc251

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

test/WebSites/Identity.DefaultUI.WebSite/StartupBase.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using Microsoft.EntityFrameworkCore;
99
using Microsoft.Extensions.Configuration;
1010
using Microsoft.Extensions.DependencyInjection;
11+
using Microsoft.Extensions.FileProviders;
1112

1213
namespace Identity.DefaultUI.WebSite
1314
{
@@ -44,7 +45,14 @@ public virtual void ConfigureServices(IServiceCollection services)
4445
.AddRoles<IdentityRole>()
4546
.AddEntityFrameworkStores<TContext>();
4647

47-
services.AddMvc();
48+
services.AddMvc()
49+
.AddRazorOptions(ro =>
50+
{
51+
// We do this to avoid file descriptor exhaustion in our functional tests
52+
// due to Razor Pages using a file watcher.
53+
ro.FileProviders.Clear();
54+
ro.FileProviders.Add(new CompositeFileProvider(new[] { new NullFileProvider() }));
55+
});
4856
}
4957

5058
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.

0 commit comments

Comments
 (0)