summaryrefslogtreecommitdiff
path: root/jstests
diff options
context:
space:
mode:
authorJason Carey <jcarey@argv.me>2019-02-05 11:46:48 -0500
committerJason Carey <jcarey@argv.me>2019-02-05 14:02:12 -0500
commit8f7034ae18cf42ed4a60168850a5511525e5bca0 (patch)
tree663180e5e3e0be97308d97bd097ea06775820069 /jstests
parent98e186577859f2aa825458ee80229ff2b5d3e950 (diff)
downloadmongo-8f7034ae18cf42ed4a60168850a5511525e5bca0.tar.gz
SERVER-39375 fix trafficRecordingFileToBSONArr
The convertTrafficRecordingToBSON function in the shell calls trafficRecordingFileToBSONArr. When called on a non-existant file, this leaves inputFd <0, which causes crashes when ::close is invoked. The fix is to move the guard which cleans up the file until after the check that it is valid
Diffstat (limited to 'jstests')
-rw-r--r--jstests/noPassthrough/traffic_reading.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/jstests/noPassthrough/traffic_reading.js b/jstests/noPassthrough/traffic_reading.js
index 18642f03be4..d9569868002 100644
--- a/jstests/noPassthrough/traffic_reading.js
+++ b/jstests/noPassthrough/traffic_reading.js
@@ -6,6 +6,10 @@
const recordingFilePath = MongoRunner.toRealDir(recordingDir + "/" + recordingFile);
const replayFilePath = MongoRunner.toRealDir(recordingDir + "/replay.txt");
+ assert.throws(function() {
+ convertTrafficRecordingToBSON("notarealfileatall");
+ });
+
// Create the recording directory if it does not already exist
mkdir(recordingDir);