Skip to content

Commit f604d25

Browse files
denis631MongoDB Bot
authored andcommitted
SERVER-99933 Adjust the currentop_shell.js test to ensure reported $currentOp contains the cursor information (#31676)
GitOrigin-RevId: 2409956
1 parent dc629bb commit f604d25

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

jstests/core/administrative/current_op/currentop_shell.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ function awaitOperations(getOperationsFunction) {
112112
print(`Found command with empty 'batchSize' value; waiting for getmore: ${
113113
tojson(operations)}`);
114114
return false;
115+
} else if (!operations.every(getCommandFromCurrentOpEntry)) {
116+
print(`Waiting until all operations have a command: ${tojson(operations)}`);
117+
return false;
115118
}
116119

117120
return true;
@@ -131,7 +134,7 @@ function getCommandFromCurrentOpEntry(entry) {
131134
"originatingCommand" in entry.cursor) {
132135
return entry.cursor.originatingCommand;
133136
} else {
134-
assert(false, entry);
137+
return null;
135138
}
136139
}
137140

0 commit comments

Comments
 (0)