Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixing tests - was getting error during indexing.

  • Loading branch information...
commit 2f66994aeb63409e0ee5d3e4b599f782fc54cc40 1 parent 834da65
@ayende ayende authored
View
13 Raven.Database/Tasks/TouchMissingReferenceDocumentTask.cs
@@ -29,7 +29,18 @@ public override void Merge(Task task)
{
var t = (TouchMissingReferenceDocumentTask)task;
- MissingReferences = MissingReferences.Union(t.MissingReferences).ToDictionary(x => x.Key, x => x.Value);
+ foreach (var kvp in t.MissingReferences)
+ {
+ HashSet<string> set;
+ if (MissingReferences.TryGetValue(kvp.Key, out set) == false)
+ {
+ MissingReferences[kvp.Key] = kvp.Value;
+ }
+ else
+ {
+ set.UnionWith(kvp.Value);
+ }
+ }
}
public override void Execute(WorkContext context)
View
5 Raven.Tests.Helpers/RavenTestBase.cs
@@ -254,7 +254,10 @@ public static void WaitForIndexing(IDocumentStore store, string db = null,TimeSp
var databaseCommands = store.DatabaseCommands;
if (db != null)
databaseCommands = databaseCommands.ForDatabase(db);
- Assert.True(SpinWait.SpinUntil(() => databaseCommands.GetStatistics().StaleIndexes.Length == 0, timeout ?? TimeSpan.FromSeconds(20)));
+ bool spinUntil = SpinWait.SpinUntil(() => databaseCommands.GetStatistics().StaleIndexes.Length == 0, timeout ?? TimeSpan.FromSeconds(20));
+ if (spinUntil == false)
+ WaitForUserToContinueTheTest((EmbeddableDocumentStore) store);
+ Assert.True(spinUntil);
}
public static void WaitForIndexing(DocumentDatabase db)
View
2  Raven.Tests/Issues/RavenDB_1280.cs
@@ -75,7 +75,7 @@ public void CanHandleMultipleMissingDocumentsInMultipleIndexes()
session.SaveChanges();
}
- WaitForIndexing(store);
+ WaitForIndexing(store, timeout: TimeSpan.FromSeconds(10));
}
}
View
5 Raven.Tryouts/Program.cs
@@ -1,4 +1,5 @@
using System;
+using Raven.Tests.Indexes;
using Raven.Tests.Issues;
using Xunit;
@@ -12,9 +13,9 @@ private static void Main(string[] args)
{
Environment.SetEnvironmentVariable("run", string.Format("{0:0000}", i));
Console.WriteLine(i);
- using (var x = new RavenDB_1041())
+ using (var x = new RavenDB_1280())
{
- x.CanWaitForReplication().Wait();
+ x.CanHandleMultipleMissingDocumentsInMultipleIndexes();
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.