The error1.js test checks consistency of the lastError and prevError commands. Our js clients may destroy a DBClientCursor at any time (as the js garbage collector runs) and send a killCursors message at any time. This killCursors message may be sent during an error1.js run, interfering with the proper running of the test.
One way to fix this would be to add the option in the shell to kill all cursors manually (through a shell command) instead of automatically through garbage collection.
Another fix is to move the error1.js and other similar error tests to the c++ client test, where we have more control over killCursors already.
Yet another fix would be to continue killing cursors in the shell triggered by gc, but to send the killCursors request via a separate db connection.