- 
    Type:Build Failure 
- 
    Resolution: Fixed
- 
    Priority:Unknown 
- 
    Affects Version/s: None
- 
    Component/s: Flaky Test
   1) x509 Authentication
        when a valid cert is provided but the certificate does not correspond to a user
          fails to authenticate:
      AssertionError: expected null to be an instance of MongoServerError
       at Context.<anonymous> (test/manual/x509_auth.test.ts:67:29)
       at processTicksAndRejections (node:internal/process/task_queues:105:5)
Notes for whoever picks this up
I spent a bit of time investigating this particular flake. I could not reproduce locally on a replica set, but I could reproduce locally on a sharded cluster. The tests are unusual - they configure the cluster with no authentication, then create / remove users in before and after hooks per test ( as needed ).
My suspicion is that this is some sort of replication lag issue - the test failure occurs because we shouldn't be able to connect, but are successfully authenticating. This test also runs after the valid auth tests, which have created a valid user.
It is probably worth trying to see if we can reproduce this issue with a different auth mechanism and maybe reporting this to the server, but I think that this is unlikely to be an issue in practice because creating / deleting the same user repeatedly is an unusual workflow and likely doesn't exist in the wild.