[SERVER-43973] jsTestName() should return a unique name for each thread in the parallel suite Created: 11/Oct/19  Updated: 29/Oct/23  Resolved: 18/Oct/19

Status: Closed
Project: Core Server
Component/s: Testing Infrastructure
Affects Version/s: None
Fix Version/s: 4.3.1, 4.2.11, 4.0.21, 3.6.23

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

Issue Links:
Backports
Depends
Problem/Incident
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.2, v4.0, v3.6
Sprint: STM 2019-10-17, STM 2019-10-31
Participants:
Linked BF Score: 16

 Description   

Otherwise tests use "basicPlus" (for example) and collide when expecting to have a unique collection name.



 Comments   
Comment by Githook User [ 29/Jan/21 ]

Author:

{'name': 'Robert Guo', 'email': 'robert.guo@mongodb.com'}

Message: SERVER-43973 Use a unique test name for each thread in ParallelTester.

This commit combines two others:

Comment by Githook User [ 24/Sep/20 ]

Author:

{'name': 'Robert Guo', 'email': 'robert.guo@mongodb.com'}

Message: SERVER-43973 Use a unique test name for each thread in ParallelTester

(cherry picked from commit 66cc9d9c2e7db216881afc605669028c55042e5e)
Branch: v4.2
https://github.com/mongodb/mongo/commit/b7959ce61aaea65ae9538cefb3617bbd8051ed08

Comment by Githook User [ 24/Sep/20 ]

Author:

{'name': 'Robert Guo', 'email': 'robert.guo@mongodb.com'}

Message: SERVER-43973 Use a unique test name for each thread in ParallelTester

(cherry picked from commit 66cc9d9c2e7db216881afc605669028c55042e5e)
(cherry picked from commit 1679ee2b3a5247b104752c489b0d029c30d576af)
Branch: v4.0
https://github.com/mongodb/mongo/commit/82daedc0abbea3acdd22e99ba0c2639a297bc9bb

Comment by Robert Guo (Inactive) [ 18/Oct/19 ]

Clarified. There were collisions before my commit.

Comment by Judah Schvimer [ 18/Oct/19 ]

Can you please clarify if there should only be namespace collisions if two tests are running in parallel before your commit or after your commit?

Comment by Robert Guo (Inactive) [ 18/Oct/19 ]

I'm going to rename this function to say that jsTestName should return a unique name for each thread in the parallel suite. There should only be namespace collisions before my commit if two tests that both use jsTestName() are running in parallel as tests should drop any collections they use before they start.

Comment by Githook User [ 17/Oct/19 ]

Author:

{'email': 'robert.guo@mongodb.com', 'name': 'Robert Guo'}

Message: SERVER-43973 Use a unique test name for each thread in ParallelTester
Branch: master
https://github.com/mongodb/mongo/commit/66cc9d9c2e7db216881afc605669028c55042e5e

Comment by Robert Guo (Inactive) [ 17/Oct/19 ]

Ha. That's perfectly aight. I saw a few usages from Query and Execution as well starting in September so you might have started a trend.

Comment by Judah Schvimer [ 16/Oct/19 ]

robert.guo, I started recommending my team use it since then if the test name changes or the test file gets copied the collection name still reflects the test file per convention.

Comment by Robert Guo (Inactive) [ 15/Oct/19 ]

A handful of tests in jstests/core that were added in September started using the jsTestName() function, which ParallelTester does not support at the moment. I wasn't able to find why we're seeing tests (in core) that use the function start popping up. We also don't seem to have recommendation for when to use it or not.

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