From 0c3e0381f3ef8d70ce07db85ece5299d3898b6c1 Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Wed, 6 Aug 2014 05:03:20 -0400 Subject: [PATCH] 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() } }