When running the full test suite, it fails to complete due to corrupted json at different points on debian9. We have seen this in the other distros, but don't have the output. Specifically we are using the debian9 docker image with python 3.5.9 pulled from python.org and compiled with valgrind.
export PYTHON3_MAJOR_VERSION=3.5
export PYTHON3_VERSION=3.5.9
export PBS_BUILD_DIR=/tmp/build-pbspro
export PBS_INSTALL_BASE=/opt
export PBS_INSTALL_DIR=$PBS_INSTALL_BASE/pbs
export PTL_INSTALL_DIR=$PBS_INSTALL_BASE/ptl
export PYTHON3_INSTALL_DIR=$PBS_INSTALL_BASE/python-$PYTHON3_VERSION
export PATH=$PYTHON3_INSTALL_DIR/bin:$PBS_INSTALL_DIR/bin:$PTL_INSTALL_DIR/bin:$PATH
export PYTHONPATH=$PTL_INSTALL_DIR/lib/python$PYTHON3_MAJOR_VERSION/site-packages:$PYTHONPATH
# --- START PYTHON INSTALL ---
cd /tmp
wget https://www.python.org/ftp/python/$PYTHON3_VERSION/Python-$PYTHON3_VERSION.tgz
tar xzf Python-$PYTHON3_VERSION.tgz
cd Python-$PYTHON3_VERSION
./configure --prefix=$PYTHON3_INSTALL_DIR --without-pymalloc --with-pydebug --with-valgrind
make -j 8
sudo make install
sudo $PYTHON3_INSTALL_DIR/bin/pip3 install --upgrade pip
sudo $PYTHON3_INSTALL_DIR/bin/pip3 install nose
sudo $PYTHON3_INSTALL_DIR/bin/pip3 install pexpect
# --- END PYTHON INSTALL ---
2020-02-17 15:25:08,701 INFO expect on server pbsdev-mgmt-ptl-debian9: job_state set 0 job ... OK
2020-02-17 15:25:08,702 INFO manager on pbsdev-mgmt-ptl-debian9 as root: set sched default {'scheduling': 'True'}
2020-02-17 15:25:08,703 INFOCLI pbsdev-mgmt-ptl-debian9: sudo -H -u root /opt/pbs/bin/qmgr -c set sched default scheduling=True
2020-02-17 15:25:08,757 INFOCLI pbsdev-mgmt-ptl-debian9: /opt/pbs/bin/qmgr -c list sched default
2020-02-17 15:25:08,774 INFO expect on server pbsdev-mgmt-ptl-debian9: scheduling = True sched default ... OK
2020-02-17 15:25:08,775 INFO ====================================
2020-02-17 15:25:08,775 INFO Completed TestHookSmokeTest tearDown
2020-02-17 15:25:08,776 INFO ====================================
Traceback (most recent call last):
File "/opt/python-3.5.9/lib/python3.5/site-packages/nose/case.py", line 134, in run
self.runTest(result)
File "/opt/python-3.5.9/lib/python3.5/site-packages/nose/case.py", line 152, in runTest
test(result)
File "/opt/python-3.5.9/lib/python3.5/unittest/case.py", line 653, in __call__
return self.run(*args, **kwds)
File "/opt/python-3.5.9/lib/python3.5/unittest/case.py", line 621, in run
result.addSuccess(self)
File "/opt/python-3.5.9/lib/python3.5/site-packages/nose/proxy.py", line 164, in addSuccess
self.plugins.addSuccess(self.test)
File "/opt/python-3.5.9/lib/python3.5/site-packages/nose/plugins/manager.py", line 99, in __call__
return self.call(*arg, **kw)
File "/opt/python-3.5.9/lib/python3.5/site-packages/nose/plugins/manager.py", line 167, in simple
result = meth(*arg, **kw)
File "/opt/ptl/lib/python3.5/site-packages/ptl/utils/plugins/ptl_test_db.py", line 1820, in addSuccess
self.__dbconn.write(self.__create_data(test, None, 'PASS'))
File "/opt/ptl/lib/python3.5/site-packages/ptl/utils/plugins/ptl_test_db.py", line 1638, in write
self.__write_test_data(data['testdata'])
File "/opt/ptl/lib/python3.5/site-packages/ptl/utils/plugins/ptl_test_db.py", line 1623, in __write_test_data
jdata = json.load(self.__dbobj[_TESTRESULT_TN])
File "/opt/python-3.5.9/lib/python3.5/json/__init__.py", line 268, in load
parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
File "/opt/python-3.5.9/lib/python3.5/json/__init__.py", line 319, in loads
return _default_decoder.decode(s)
File "/opt/python-3.5.9/lib/python3.5/json/decoder.py", line 342, in decode
raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 7030 column 2 (char 270460)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/ptl/bin/pbs_benchpress", line 508, in <module>
nose.main(defaultTest=tests, argv=[sys.argv[0]], plugins=plugins)
File "/opt/python-3.5.9/lib/python3.5/site-packages/nose/core.py", line 121, in __init__
**extra_args)
File "/opt/python-3.5.9/lib/python3.5/unittest/main.py", line 95, in __init__
self.runTests()
File "/opt/python-3.5.9/lib/python3.5/site-packages/nose/core.py", line 207, in runTests
result = self.testRunner.run(self.test)
File "/opt/ptl/lib/python3.5/site-packages/ptl/utils/plugins/ptl_test_runner.py", line 498, in run
test(result)
File "/opt/python-3.5.9/lib/python3.5/site-packages/nose/suite.py", line 178, in __call__
return self.run(*arg, **kw)
File "/opt/python-3.5.9/lib/python3.5/site-packages/nose/suite.py", line 225, in run
test(orig)
File "/opt/python-3.5.9/lib/python3.5/site-packages/nose/suite.py", line 178, in __call__
return self.run(*arg, **kw)
File "/opt/python-3.5.9/lib/python3.5/site-packages/nose/suite.py", line 225, in run
test(orig)
File "/opt/python-3.5.9/lib/python3.5/site-packages/nose/suite.py", line 178, in __call__
return self.run(*arg, **kw)
File "/opt/python-3.5.9/lib/python3.5/site-packages/nose/suite.py", line 225, in run
test(orig)
File "/opt/python-3.5.9/lib/python3.5/site-packages/nose/suite.py", line 178, in __call__
return self.run(*arg, **kw)
File "/opt/python-3.5.9/lib/python3.5/site-packages/nose/suite.py", line 225, in run
test(orig)
File "/opt/python-3.5.9/lib/python3.5/site-packages/nose/case.py", line 46, in __call__
return self.run(*arg, **kwarg)
File "/opt/python-3.5.9/lib/python3.5/site-packages/nose/case.py", line 139, in run
result.addError(self, err)
File "/opt/python-3.5.9/lib/python3.5/site-packages/nose/proxy.py", line 131, in addError
plugins.addError(self.test, err)
File "/opt/python-3.5.9/lib/python3.5/site-packages/nose/plugins/manager.py", line 99, in __call__
return self.call(*arg, **kw)
File "/opt/python-3.5.9/lib/python3.5/site-packages/nose/plugins/manager.py", line 167, in simple
result = meth(*arg, **kw)
File "/opt/ptl/lib/python3.5/site-packages/ptl/utils/plugins/ptl_test_db.py", line 1814, in addError
self.__dbconn.write(self.__create_data(test, err, 'ERROR'))
File "/opt/ptl/lib/python3.5/site-packages/ptl/utils/plugins/ptl_test_db.py", line 1638, in write
self.__write_test_data(data['testdata'])
File "/opt/ptl/lib/python3.5/site-packages/ptl/utils/plugins/ptl_test_db.py", line 1623, in __write_test_data
jdata = json.load(self.__dbobj[_TESTRESULT_TN])
File "/opt/python-3.5.9/lib/python3.5/json/__init__.py", line 268, in load
parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
File "/opt/python-3.5.9/lib/python3.5/json/__init__.py", line 319, in loads
return _default_decoder.decode(s)
File "/opt/python-3.5.9/lib/python3.5/json/decoder.py", line 342, in decode
raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 7030 column 2 (char 270460)
sys:1: ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/build-pbspro/test/tests/ptl_test_results.json' mode='w+' encoding='ANSI_X3.4-1968'>
Below are 3 different tails of the json database.
>>>tail -n 16 ptl_test_results.json
},
"module": "tests.functional.pbs_accumulate_resc_used",
"file": "tests/functional/pbs_accumulate_resc_used.py",
"docstring": "This tests the feature in PBS that enables mom hooks to accumulate resources_used values for resources beside cput, cpupercent, and mem. This includes accumulation of custom resources. The mom hooks supported this feature are: exechost_periodic, execjob_prologue, and execjob_epilogue. PRE: Have a cluster of PBS with 3 mom hosts, with an exechost_startup that adds custom resources. POST: When a job ends, accounting_logs reflect the aggregated resources_used values. And with job_history_enable=true, one can do a 'qstat -x -f <jobid>' to obtain information of a previous job."
}
},
"user": "pershey",
"test_conf": {},
"additional_data": {}
}ave a cluster of PBS with 3 mom hosts, with an exechost_startup that adds custom resources. POST: When a job ends, accounting_logs reflect the aggregated resources_used values. And with job_history_enable=true, one can do a 'qstat -x -f <jobid>' to obtain information of a previous job."
}
},
"user": "pershey",
"test_conf": {},
"additional_data": {}
}
>>>tail -n 16 ptl_test_results2.json
"run_id": "1581916219",
"user": "pershey",
"product_version": "19.0.0",
"additional_data": {}
}l_data": {},
"run_id": "1581916219",
"user": "pershey",
"test_conf": {},
"machine_info": {
"pbsdev-mgmt-ptl-debian9": {
"pbs_install_type": "server",
"platform": "Linux pbsdev-mgmt-ptl-debian9 5.0.0-38-generic #41-Ubuntu SMP Tue Dec 3 00:27:35 UTC 2019 x86_64 ",
"os_info": "Linux-5.0.0-38-generic-x86_64-with-debian-9.11"
}
}
}
>>>tail -n 16 ptl_test_results3.json
"product_version": "19.0.0",
"additional_data": {}
}memory_spread_page",
"test_cgroup_cpuset_ncpus_are_cores",
"test_submit_job_comp",
"test_fairshare_formula",
"test_fairshare_formula2",
"test_fairshare_formula4",
"test_fairshare_formula6",
"test_movejob_hook"
],
"test_end_time": "2020-02-17 15:24:54.933983"
},
"test_conf": {},
"product_version": "19.0.0"
}
The problem seems to be inside ptl_test_db.py in the class JSONDb.