-
-
Notifications
You must be signed in to change notification settings - Fork 306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.only runs all tests with same name #299
Comments
Can someone make sure my fix doesn't introduce a race condition? A race condition could potentially happen if multiple test modules are loaded asynchronously AND the increment operator is not atomic. We might then have multiple tests with the same ID. See line 48 of |
This SO answer says that ++ is not guaranteed to be atomic, so the next question is, does tape otherwise support asynchronous loading? http://stackoverflow.com/questions/680097/ive-heard-i-isnt-thread-safe-is-i-thread-safe/680114#680114 |
That's in C++ - JS is single-threaded. You don't have to worry about it. |
Ah yes! Thanks for the reminder. I actually program in Java for Android too, where I have to worry about these things. I've written a way to pass a command line
Any suggestions for me? Then I'll write the feature request and make its PR. Thanks! |
(My |
(Okay, nevermind. My |
- [Fix] `throws`: only reassign “message” when it is not already non-enumerable (#320) - [Fix] show path for error messages on windows (#316) - [Fix] `.only` should not run multiple tests with the same name (#299, #303) - [Deps] update `glob`, `inherits` - [Dev Deps] update `concat-stream`, `tap`, `tap-parser`, `falafel` - [Tests] [Dev Deps] Update to latest version of devDependencies tap (v7) and tap-parser (v2) (#318) - [Tests] ensure the max_listeners test has passing output - [Docs] improvements (#298, #317)
I have a fix for this already, just wanted to give it an issue # before PRing.
.only
identifies the test to run by the name of the test. If the developer (accidentally) writes multiple tests with the same name and one of those tests is declared.only
, all tests having this duplicated name are run.There are two main approaches to solving this. We can enforce test name uniqueness, or we can generate a unique ID for each test and use that ID. The former would be helpful to the developer, but the latter is simpler, faster, and makes a good setup for a desperately needed feature whereby we can run a single test without having to muck with the code. (I'll post this feature shortly.)
The text was updated successfully, but these errors were encountered: