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.
This commit is contained in:
parent
f441fc4bbf
commit
0c3e0381f3
1 changed files with 6 additions and 0 deletions
|
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue