You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I seem to be running into an issue while using the Snapshot functionality of your package. I'm using this in combination with Umbraco 10 and I'm creating a snapshot after Umbraco is installed in the database, so I can return to a fresh install after each test.
The snapshot throws this exception on our buildserver. The identifier includes a very long path, too long it seems. The functionality works just fine on my local machine though.
Can you give me any advice on how to proceed? I couldn't find any configurations that allow me to modify this identifier, so I'm not sure what to do.
Here's the stacktrace, in case you need it:
at Microsoft.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at Microsoft.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean isAsync, Int32 timeout, Boolean asyncWrite)
at Microsoft.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry, String methodName)
at Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at ThrowawayDb.ThrowawayDatabase.CreateSnapshot()
at ThrowawayDb.SnapshotScope..ctor(ThrowawayDatabase db)
at ThrowawayDb.ThrowawayDatabaseExtensions.CreateSnapshotScope(ThrowawayDatabase this)
at UrlTracker.IntegrationTests.IntegrationTestBase.Setup() in C:\[myuserfolder]\UrlTracker.IntegrationTests\IntegrationTestBase.cs:line 33
at UrlTracker.IntegrationTests.Redirecting.RedirectTestBase.Setup() in C:\[myuserfolder]\UrlTracker.IntegrationTests\Redirecting\RedirectTestBase.cs:line 32
And here's how I use it in code:
publicclassIntegrationTestBase{protectedThrowawayDatabaseDatabase{get;privateset;}publicSnapshotScopeSnapshotScope{get;privateset;}protectedUrlTrackerWebApplicationFactoryWebsiteFactory{get;privateset;}protectedAsyncServiceScopeScope{get;privateset;}protectedIServiceProviderServiceProvider=> Scope.ServiceProvider;[OneTimeSetUp]publicvirtualvoidOneTimeSetup(){Database= ThrowawayDatabase.FromLocalInstance(@"(LocalDb)\MSSQLLocalDB");// Install Umbraco on the temporary databaseusingvarfactory=new UrlTrackerWebApplicationFactory(Database);varclient= factory.CreateClient();varpolicy= HttpPolicyExtensions.HandleTransientHttpError().RetryAsync(3);
policy.ExecuteAsync(()=> client.GetAsync("/")).Wait();}[SetUp]publicvirtualvoidSetup(){// create database snapshot to return to after each testSnapshotScope= Database.CreateSnapshotScope();WebsiteFactory=new UrlTrackerWebApplicationFactory(Database);Scope= WebsiteFactory.Services.GetRequiredService<IServiceScopeFactory>().CreateAsyncScope();}[TearDown]publicvirtualvoidTearDown(){
Scope.Dispose();
WebsiteFactory.Dispose();
SnapshotScope.Dispose();}[OneTimeTearDown]publicvirtualvoidOneTimeTeardown(){
Database.Dispose();}}
Any advice is appreciated
The text was updated successfully, but these errors were encountered:
I seem to be running into an issue while using the Snapshot functionality of your package. I'm using this in combination with Umbraco 10 and I'm creating a snapshot after Umbraco is installed in the database, so I can return to a fresh install after each test.
The snapshot throws this exception on our buildserver. The identifier includes a very long path, too long it seems. The functionality works just fine on my local machine though.
Can you give me any advice on how to proceed? I couldn't find any configurations that allow me to modify this identifier, so I'm not sure what to do.
Here's the stacktrace, in case you need it:
And here's how I use it in code:
Any advice is appreciated
The text was updated successfully, but these errors were encountered: