From 0c3e0381f3ef8d70ce07db85ece5299d3898b6c1 Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Wed, 6 Aug 2014 05:03:20 -0400 Subject: [PATCH 1/2] Fix the integration test from crashing Sessions are expected to only have one running query (perhaps this is a bug). So we need to make a new session for each of the benchmark runs, timing only the running part. --- cayley_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cayley_test.go b/cayley_test.go index b94389a..15428a8 100644 --- a/cayley_test.go +++ b/cayley_test.go @@ -363,12 +363,18 @@ func runBench(n int, b *testing.B) { if err != nil { b.Fatalf("Failed to parse benchmark gremlin %s: %v", benchmarkQueries[n].message, err) } + b.StopTimer() b.ResetTimer() for i := 0; i < b.N; i++ { c := make(chan interface{}, 5) + ses := gremlin.NewSession(ts, cfg.Timeout, true) + // Do the parsing we know works. + ses.InputParses(benchmarkQueries[n].query) + b.StartTimer() go ses.ExecInput(benchmarkQueries[n].query, c, 100) for _ = range c { } + b.StopTimer() } } From 11891f02a978b50d0b3aa03a7fab9dec380e0019 Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Wed, 6 Aug 2014 05:19:46 -0400 Subject: [PATCH 2/2] remove lead-in parsing test --- cayley_test.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/cayley_test.go b/cayley_test.go index 15428a8..96461e7 100644 --- a/cayley_test.go +++ b/cayley_test.go @@ -358,11 +358,6 @@ func runBench(n int, b *testing.B) { b.Skip() } prepare(b) - ses := gremlin.NewSession(ts, cfg.Timeout, true) - _, err := ses.InputParses(benchmarkQueries[n].query) - if err != nil { - b.Fatalf("Failed to parse benchmark gremlin %s: %v", benchmarkQueries[n].message, err) - } b.StopTimer() b.ResetTimer() for i := 0; i < b.N; i++ {