This commit is contained in:
2018-09-28 18:58:22 +00:00
parent 1e3ccfcc14
commit fcb61e7ad5
4 changed files with 53 additions and 11 deletions

View File

@@ -451,7 +451,7 @@ namespace raven_integration
[Fact]
public async void BigDataSearchShouldHonourMaxResultsAndBeRelativelyFast()
public async void ConstrainedBigDataSearchShouldHonourMaxResultsAndBeRelativelyFast()
{
//THIS test is a bit different in that it relies partly on the big dataset for testing
@@ -481,7 +481,44 @@ namespace raven_integration
ResultCount.Should().BeLessOrEqualTo(1000);
//1755ms is the longest I've seen in initial testing with all 1000 results so setting slightly above
TimeToSearch.Should().BeLessThan(1760, "Big data search should not be too slow");
TimeToSearch.Should().BeLessThan(1760, "Constrained big data search should not be too slow");
}//eot
[Fact]
public async void UnboundBigDataSearchShouldBeRelativelyFast()
{
//THIS test is a bit different in that it relies partly on the big dataset for testing
//so it has different paths depending upon if it's testing against the big data or not
const string TEST_SEARCH_PHRASE = "et*";
//Now see if can find those objects with a phrase search
dynamic SearchParameters = new JObject();
SearchParameters.phrase = TEST_SEARCH_PHRASE;
SearchParameters.nameOnly = false;
SearchParameters.typeOnly = 0;//no type
SearchParameters.maxResults = 0;//0=return all results
var watch = new System.Diagnostics.Stopwatch();
watch.Start();
ApiResponse a = await Util.PostAsync("Search", await Util.GetTokenAsync("manager", "l3tm3in"), SearchParameters.ToString());
watch.Stop();
var TimeToSearch = watch.ElapsedMilliseconds;
Util.ValidateDataReturnResponseOk(a);
//Now validate the return list
var ResultCount = ((JArray)a.ObjectResponse["result"]).Count;
//assert it's not unbounded
// ResultCount.Should().BeGreaterThan(1000);
//24072 ms is the longest I've seen in initial testing with all bigData seeded results so setting slightly above
TimeToSearch.Should().BeLessThan(24072, "Unconstrained big data search should not be too slow");
//Fastest is 17227 ms with 14143 results
}//eot