[SERVER-61732] Prevent threads spawned outside ThreadContextTest from updating test counters Created: 24/Nov/21  Updated: 29/Oct/23  Resolved: 04/Jan/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.3.0, 5.0.21

Type: Improvement Priority: Major - P3
Reporter: Vojislav Stojkovic Assignee: Vojislav Stojkovic
Resolution: Fixed Votes: 0
Labels: auto-reverted
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Backwards Compatibility: Fully Compatible
Backport Requested:
v5.0
Sprint: Service Arch 2021-12-13, Service Arch 2022-1-10
Participants:
Linked BF Score: 12

 Description   

The non-deterministic and sporadic test failure in BF-22755 seems to be caused by a left-over thread from a different test terminating while the ThreadContextTest suite is running. Since TestDecoration would be applied to any thread, not just those created in the test suite, this would cause the counters to be modified unexpectedly. The solution is to make sure that only the threads spawned inside this test suite can modify the counters.



 Comments   
Comment by Githook User [ 10/Aug/23 ]

Author:

{'name': 'Vojislav Stojkovic', 'email': 'vojislav.stojkovic@mongodb.com', 'username': 'vstojkovic-mongodb'}

Message: SERVER-61732 Prevent threads spawned outside ThreadContextTest from updating test counters

(cherry picked from commit 059829a65c152d9701cacbb635bee6896d29667f)
Branch: v5.0
https://github.com/mongodb/mongo/commit/42d85f23c4dcc560c8d290eb134ab5caefa77ef1

Comment by Githook User [ 23/Dec/21 ]

Author:

{'name': 'Vojislav Stojkovic', 'email': 'vojislav.stojkovic@mongodb.com', 'username': 'vstojkovic-mongodb'}

Message: SERVER-61732 Prevent threads spawned outside ThreadContextTest from updating test counters
Branch: master
https://github.com/mongodb/mongo/commit/059829a65c152d9701cacbb635bee6896d29667f

Comment by xgen-buildbaron-user [ 22/Dec/21 ]

Ticket re-opened due to revert. run_unittests began a consistent failure of build\install\bin\util_test.exe

Comment by Githook User [ 22/Dec/21 ]

Author:

{'name': 'auto-revert-processor', 'email': 'dev-prod-dag@mongodb.com'}

Message: Revert "SERVER-61732 Prevent threads spawned outside ThreadContextTest from updating test counters"

This reverts commit ff375f0ae47b960f46a8606d0f5fd6558230709b.
Branch: master
https://github.com/mongodb/mongo/commit/60f32a2e789ad4fcab61d80ffd57ba930f088117

Comment by Githook User [ 21/Dec/21 ]

Author:

{'name': 'Vojislav Stojkovic', 'email': 'vojislav.stojkovic@mongodb.com', 'username': 'vstojkovic-mongodb'}

Message: SERVER-61732 Prevent threads spawned outside ThreadContextTest from updating test counters
Branch: master
https://github.com/mongodb/mongo/commit/ff375f0ae47b960f46a8606d0f5fd6558230709b

Generated at Thu Feb 08 05:53:11 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.