The profile_getmore.js test creates a cursor and assigns its client-side DBQuery representation to a variable called cursor:
It then leaves this cursor open on the server, while the client assigns a second DBQuery object to the cursor variable:
The abandoned cursor, however, may now be garbage collected by the shell at any time. When a DBQuery is garbage collected, it issues a killCursors command to the server in order to clean up any server-side state. Therefore, after line 81, a killCursors command may at any arbitrary point during the test's execution be issued against the database under test. The test's assertions are not prepared to handle such a command appearing in the system.profile entry. We must fix the test to either
- tolerate the possibility of a killCursors command, or
- be careful to close the cursor before abandoning it.