[SERVER-39000] Unittest framework incorrectly handles initialization of serverCompatibilityVersion Created: 14/Jan/19  Updated: 29/Oct/23  Resolved: 25/Jan/19

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.1.8

Type: Bug Priority: Major - P3
Reporter: ADAM Martin (Inactive) Assignee: ADAM Martin (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Dev Tools 2019-01-28
Participants:

 Description   

Some DBTests are Test Suites, but don't have UnitTest members, thus the existing SCV fix doesn't work right for them.  Further, the existing SCV fix causes some tests to potentially miss the SCV fix anyhow.



 Comments   
Comment by Githook User [ 25/Jan/19 ]

Author:

{'username': 'adamlsd', 'email': 'adam.martin@10gen.com', 'name': 'ADAM David Alan Martin'}

Message: SERVER-39000 Fix Unittest Framework initialization.

Some tests in `dbtest` do not use the `mongo::unittest::Test` class
as a basis for their implementation and thus need some way to benefit
from global DB Environment initialization functions. Specifically
the changes in SERVER-32630 required `serverCompatibilityVersion`
to be set sensibly. Some tests in `dbtest` were not correctly
getting this benefit; instead only incidentally getting a correct
setting by accident, as the results of an unintended residue of
an earlier operation. This can lead to inconsistentcies in which
tests pass, as link order changes – the tests are registered using
static initialization, whose instability of order can cause
mysterious failures in `dbtest`.
Branch: master
https://github.com/mongodb/mongo/commit/677a65ba43fecf7cf20b7a2c34b5ec2bed413edd

Comment by Githook User [ 16/Jan/19 ]

Author:

{'username': 'adamlsd', 'email': 'adam.martin@10gen.com', 'name': 'ADAM David Alan Martin'}

Message: SERVER-39000 Fix Unittest Framework initialization.

Some tests in `dbtest` do not use the `mongo::unittest::Test` class
as a basis for their implementation and thus need some way to benefit
from global DB Environment initialization functions. Specifically
the changes in SERVER-32630 required `serverCompatibilityVersion`
to be set sensibly. Some tests in `dbtest` were not correctly
getting this benefit; instead only incidentally getting a correct
setting by accident, as the results of an unintended residue of
an earlier operation. This can lead to inconsistentcies in which
tests pass, as link order changes – the tests are registered using
static initialization, whose instability of order can cause
mysterious failures in `dbtest`.
Branch: SERVER-29286
https://github.com/mongodb/mongo/commit/9aa2832dae9477784d4a347b3f0c9de3a357e863

Generated at Thu Feb 08 04:50:42 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.