mongodb / mongo-perf

performance tools for mongodb
351 stars 140 forks source link

Error when executing benchmark #99

Open svenkata9 opened 2 years ago

svenkata9 commented 2 years ago

I am hitting the below error when I am executing the test. Any help would be appreciated.

mongo-perf (master) $ python3 benchrun.py -f testcases/simple_insert.js -t 1 2 4
MongoDB shell version v5.0.9
connecting to: mongodb://localhost:27017/?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("878b677f-fbeb-425d-a1b4-9add2ac31d6d") }
MongoDB server version: 5.0.9
db version: 5.0.9
6f7dae919422dcd7f4892c10ff20cdc721ad00e6

load('util/utils.js');
load('util/docGenerators.js');
load('testcases/simple_insert.js');
mongoPerfRunTests([1, 2, 4], 1, 1, 5, 1, "%", [], 0, {"writeConcern": {"j": "false"}, "writeCmdMode": "true", "readCmdMode": "false"}, false, false, false, {"traceOnly": false});
Error: __init__() got an unexpected keyword argument 'text'
Catwoolfii commented 2 years ago

+1

DarioValocchi commented 2 years ago

+1

DarioValocchi commented 2 years ago

Looks like it's a problem with subprocess.Popen init signature which differs between python versions. You can try to patch benchrun.py on line 232:

diff --git a/benchrun.py b/benchrun.py
index e1f7153..b634dd4 100644
--- a/benchrun.py
+++ b/benchrun.py
@@ -229,7 +229,7 @@ def main():
         # Open a mongo shell subprocess and load necessary files.
         mongo_proc = Popen([args.shellpath, "--norc", "--quiet", js_file.name,
                            "--host", args.hostname, "--port", args.port] + auth,
-                           stdout=PIPE, text=True)
+                           stdout=PIPE, universal_newlines=True)

         # Read test output.
         readout = False