Skip to content

Commit

Permalink
remove unused WaitForUserToContinueTheTest
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Feb 5, 2015
1 parent 6d3bb6c commit 489f492
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using Infrastructure.RavenDB;
using MessageFailures;
using NUnit.Framework;
using Raven.Client;
using ServiceControl.MessageFailures.Api;

[TestFixture]
public class FailedMessagesTests : TestWithRavenDB
public class FailedMessagesTests
{
[Test]
public void Should_allow_errors_with_no_metadata()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System.Collections.Generic;
using System.Linq;
using Contracts.Operations;
using Infrastructure.RavenDB;
using MessageAuditing;
using MessageFailures;
using NUnit.Framework;
Expand All @@ -13,7 +12,7 @@
using ServiceControl.CompositeViews.Messages;

[TestFixture]
public class MessagesViewTests : TestWithRavenDB
public class MessagesViewTests
{
[Test]
public void Filter_out_system_messages()
Expand Down Expand Up @@ -82,7 +81,7 @@ public void Order_by_critical_time()
session.SaveChanges();
}

WaitForIndexing(documentStore);
documentStore.WaitForIndexing();

using (var session = documentStore.OpenSession())
{
Expand Down Expand Up @@ -125,7 +124,7 @@ public void Order_by_time_sent()
session.SaveChanges();
}

WaitForIndexing(documentStore);
documentStore.WaitForIndexing();

using (var session = documentStore.OpenSession())
{
Expand Down Expand Up @@ -161,7 +160,7 @@ public void Correct_status_for_repeated_errors()
session.SaveChanges();
}

WaitForIndexing(documentStore);
documentStore.WaitForIndexing();

using (var session = documentStore.OpenSession())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using Infrastructure.RavenDB;
using MessageAuditing;
using MessageFailures;
using NUnit.Framework;
Expand All @@ -13,7 +12,7 @@
using ServiceControl.Infrastructure.RavenDB.Expiration;

[TestFixture]
public class CustomExpirationBundleTests : TestWithRavenDB
public class CustomExpirationBundleTests
{
[Test]
public void Processed_messages_are_being_expired()
Expand All @@ -38,7 +37,7 @@ public void Processed_messages_are_being_expired()
session.SaveChanges();
}

WaitForIndexing(documentStore);
documentStore.WaitForIndexing();
Thread.Sleep(Settings.ExpirationProcessTimerInSeconds * 1000 * 2);

using (var session = documentStore.OpenSession())
Expand Down Expand Up @@ -85,7 +84,7 @@ public void Many_processed_messages_are_being_expired()
session.SaveChanges();
}

WaitForIndexing(documentStore);
documentStore.WaitForIndexing();
Thread.Sleep(Settings.ExpirationProcessTimerInSeconds * 1000 * 10);
using (var session = documentStore.OpenSession())
{
Expand Down Expand Up @@ -125,7 +124,7 @@ public void Only_processed_messages_are_being_expired()
session.SaveChanges();
}

WaitForIndexing(documentStore);
documentStore.WaitForIndexing();
Thread.Sleep(Settings.ExpirationProcessTimerInSeconds * 1000 * 2);

using (var session = documentStore.OpenSession())
Expand Down Expand Up @@ -155,7 +154,7 @@ public void Recent_processed_messages_are_not_being_expired()
session.SaveChanges();
}

WaitForIndexing(documentStore);
documentStore.WaitForIndexing();
Thread.Sleep(Settings.ExpirationProcessTimerInSeconds * 1000 * 2);

using (var session = documentStore.OpenSession())
Expand Down Expand Up @@ -191,7 +190,7 @@ public void Errors_are_not_being_expired()
session.SaveChanges();
}

WaitForIndexing(documentStore);
documentStore.WaitForIndexing();
Thread.Sleep(Settings.ExpirationProcessTimerInSeconds * 1000 * 2);

using (var session = documentStore.OpenSession())
Expand Down

This file was deleted.

14 changes: 14 additions & 0 deletions src/ServiceControl.UnitTests/RavenIndexAwaiter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;
using System.Threading;
using NUnit.Framework;
using Raven.Client;

public static class RavenIndexAwaiter
{
public static void WaitForIndexing(this IDocumentStore store)
{
var databaseCommands = store.DatabaseCommands;
Assert.True(SpinWait.SpinUntil(() => databaseCommands.GetStatistics().StaleIndexes.Length == 0, TimeSpan.FromSeconds(10)));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
<Compile Include="Heartbeats\HeartbeatStatusProviderTests.cs" />
<Compile Include="Infrastructure\RavenDB\Indexes\InMemoryStoreBuilder.cs" />
<Compile Include="Infrastructure\RavenDB\RavenBootstrapperTests.cs" />
<Compile Include="Infrastructure\RavenDB\TestWithRavenDB.cs" />
<Compile Include="RavenIndexAwaiter.cs" />
<Compile Include="Infrastructure\TransportMessageExtensionsTests.cs" />
<Compile Include="Operations\UpdateLicenseEnricherTest.cs" />
</ItemGroup>
Expand Down

0 comments on commit 489f492

Please sign in to comment.