MongoDB connection closed/aborted during tests run

Hello, I’m trying to contribute to Beanie project, which is an object-document mapper for MongoDB. As required, I’ve set up a replica set in MongoDB. When comes the moment to run the tests in order to ensure everything is ok, the tests pass up to a point where the connection to the database is closed, resulting in the remaining tests to fail.
First, it would be the following error (but not always for the same test) :
ERROR tests/odm/test_actions.py::TestActions::test_actions_update[DocumentWithActions] - pymongo.errors.AutoReconnect: localhost:27017: connection closed then all remaining will be
ERROR tests/odm/test_actions.py::TestActions::test_actions_update[DocumentWithActions2] - pymongo.errors.OperationFailure: command listIndexes requires authentication, full error: SON([('ok', 0.0), ('errmsg', 'command listIndexes requi...

I’m posting my issue here because I believe this is more related to my MongoDB setup rather than Beanie. Testing in the odm is done in order to ensure the stability of the project and independence among test cases. See testing. I’m quite beginning with actual MongoDB setup. Regarding the error message for authentication, I think this is because of a background running process which is probably there because of the way I installed Mongo.

ps aux | grep mongo
systemd+    1793  0.3  0.6 1560592 52072 ?       Ssl  08:34   1:33 mongod --auth --bind_ip_all
teddy      13290  0.0  0.0 33788804 7080 ?       S    09:50   0:00 /usr/lib/mongodb-compass/MongoDB Compass --type=zygote --no-zygote-sandbox
teddy      13291  0.0  0.1 33788788 10124 ?      S    09:50   0:00 /usr/lib/mongodb-compass/MongoDB Compass --type=zygote
teddy      13293  0.0  0.0 33788788 7248 ?       S    09:50   0:00 /usr/lib/mongodb-compass/MongoDB Compass --type=zygote
teddy      13342  1.1  0.5 34104240 43892 ?      Sl   09:50   4:53 /usr/lib/mongodb-compass/MongoDB Compass --type=gpu-process --enable-crash-reporter=9fde1412-1ffb-4741-bf26-1c335d4eb20b,no_channel --user-data-dir=/home/teddy/.config/MongoDB Compass --gpu-preferences=WAAAAAAAAAAgAAAIAAAAAAAAAAAAAAAAAABgAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAIAAAAAAAAAABAAAAAAAAAAgAAAAAAAAACAAAAAAAAAAIAAAAAAAAAA== --shared-files --field-trial-handle=0,i,14383086231675327751,13476990132253878786,131072 --disable-features=SpareRendererForSitePerProcess
teddy      13357  0.0  0.1 33846588 15724 ?      Sl   09:50   0:01 /usr/lib/mongodb-compass/MongoDB Compass --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --enable-crash-reporter=9fde1412-1ffb-4741-bf26-1c335d4eb20b,no_channel --user-data-dir=/home/teddy/.config/MongoDB Compass --shared-files=v8_context_snapshot_data:100 --field-trial-handle=0,i,14383086231675327751,13476990132253878786,131072 --disable-features=SpareRendererForSitePerProcess
teddy      13370  5.9  1.2 1184746880 101840 ?   Sl   09:50  25:37 /usr/lib/mongodb-compass/MongoDB Compass --type=renderer --enable-crash-reporter=9fde1412-1ffb-4741-bf26-1c335d4eb20b,no_channel --user-data-dir=/home/teddy/.config/MongoDB Compass --app-path=/usr/lib/mongodb-compass/resources/app.asar --no-sandbox --no-zygote --first-renderer-process --lang=en-US --num-raster-threads=2 --enable-main-frame-before-activation --renderer-client-id=4 --time-ticks-at-unix-epoch=-1698219183736592 --launch-time-ticks=4665436903 --shared-files=v8_context_snapshot_data:100 --field-trial-handle=0,i,14383086231675327751,13476990132253878786,131072 --disable-features=SpareRendererForSitePerProcess
teddy      14449  0.0  0.5 1177357352 43760 ?    Sl   10:03   0:01 /usr/lib/mongodb-compass/MongoDB Compass /usr/lib/mongodb-compass/resources/app.asar.unpacked/node_modules/@mongosh/node-runtime-worker-thread/dist/child-process-proxy.js
teddy      23931  0.0  0.7 1353164 60660 pts/4   Sl+  10:56   0:04 mongosh mongodb://12
teddy      52801  0.0  0.0   9208  2176 pts/2    S+   17:04   0:00 grep --color=auto mongo

The line systemd+ 1793 0.3 0.6 1560592 52072 ? Ssl 08:34 1:33 mongod --auth --bind_ip_all indicates, I think, that some instance is running and indeed requiring authentication.
For Beanie, the database is hosted locally on port 27017 and does not require authentication. For that then, I create a connection which doesn’t require authentication with the following command : sudo mongod --replSet rs0 --port 27017 --dbpath /var/lib/mongodb -v but when launching the tests I face the issue I described which is the database connection gets closed at a point and authentication is required (due to the running background process I presume).
Your help and guidance on this will be very appreciated. Thanks.