-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Testing
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Network and command errors encountered in multi-threaded monitoring are logged as debug errors (with level MONGOC_LOG_LEVEL_DEBUG). They should be logged as MONGOC_LOG_LEVEL_ERROR and MONGOC_LOG_LEVEL_WARNING.
They were left as debug logs in CDRIVER-3535. This was because error/warning logs are printed to stderr. The test script compile-unix.sh asserts that tests nothing is printed to stderr. But many tests simulate monitoring errors with the mock server. See this conversation in the PR for more context. https://github.com/mongodb/mongo-c-driver/pull/625/files/65977607f7e1d500dfa4123711452c435ab08d3c#r435400372
We may need to add calls to capture_logs() in all tests where we expect monitoring errors to occur, so they do not get printed to stderr.
Also consider:
- Errors encountered in single-threaded monitoring are not logged. If these are generally useful, it follows we should add similar logs for single-threaded monitoring in mongoc-async.c.
- have test-libmongoc make assertions that unexpected error logs are not encountered. This way, it will be easier to test these assertions locally, and on any platform.