-
Notifications
You must be signed in to change notification settings - Fork 8
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
Concurrency should be supported. #15
Comments
Not a fan of this syntax really, I think it adds more complexity to a simple problem. #14 keeps things much simpler and retaining subtest nesting can be achieved in other ways (for example 1.x.x). I'm also not entirely sure how it would help with subtest matching, assuming you had lots of processes and sub processes parsing each test the proc id wouldn't help unless you provided which processes spawned other processes. It also runs against what TAP is about, human readable test output. |
@exodist wouldn't the same be possible with test diagnostics? Like JSON or YAMLish providing threading/proc/cpuid about the tests? The s-prefix for subtests looks interesting though, since if we drop indentation we'll have to find some way to avoid duplicated test plans being detected. |
@exodist @kinow how about instead of process id's which I still can't see how they would work, providing a version 5 UUID for unnumbered tests. I don't really like the idea for the same reason to adding noise to an otherwise human readable format however something like this might work:
The UUID could be calculated from the test name itself and perhaps a unique codebase namespave. So if there were multiple instances of the same test, they would have the same UUID (this for me is the number one reason why test's are not numbered because it is the same tests ran a number of times based on the outcome of something else like database rows). The advantage of this approach are:
Disadvantages:
As mentioned above, more complex testing plans would also resolve my issues with the proc id's.
Where:
|
I worry that things are moving to be to complicated. So what this all boils down to is this: It is impossible for a consumer to know what lines are associated, and what ones are not. This produces multiple problems, among which are: Diagnostics are disconnected from failed tests, compounded by the fact that producers often send the results to stdout and the diags to stderr. It also causes a problem when there is concurrency, even if the producer is able to keep numbers ordered, the diag can be unordered. It also makes it harder for subtests, particularily when threaded, but not exclusively. So for concurrency we have 2 problems to solve:
I think we should focus on solving the first, which will also help with many other issues in the queue. The second is less critical and can be solved by the producer fairly well so long as the first issue is solved. Also, we must recognize one of the most important benefits of current TAP, simplicity. It is trivial to make a TAP producer, and I think the wide adoption of TAP is largely due to the simplicity. To this end I think we should make the grouping mechanism as simple as possible, and OPTIONAL. Now, how can we keep this simple, and optional? I suggest an OPTIONAL prefix, initially I was thinking I suggest we use square braces, and allow people to put any identifiers they want in. I also suggest a nested identifier system, I think '.' would be a good separator, but we can bike-shed that later. so like this:
For producers: This is simple, they can use any identifiers they want, they use brackets to put them together, and they use a separator (.) to nest them. This is simple, this is flexible, and we make it optional. For consumers: Using the identifiers is optional, for many applications the identifiers are not something they need to worry about, so many consumers can simply strip off the identifiers and ignore them. This is for things that really do not care if a diag is grouped with a test. The identifiers are purely for extra information. We should also setup an environment variable, if it is NOT set then a producer should NOT provide the prefixes. But I think that is for another ticket. Note: This doesn't solve the subtest plan problem when the identifiers are not used, but since subtests were not supported in current tap anyway maybe moving forward subtests will require identifiers to be officially supported. |
I think you outlined our current situation very well @exodist !!! Kudos :-) +1 for keeping it simple, and maybe optional too. I'll re-read it again tomorrow to see if I can come with some good suggestion too. |
This all sounds like making things way too complicated to me. |
Good idea. I'd prefer for it to be an infix rather than a prefix (like |
I would rather this be suffix as it is the least important item for humans to read and should be optional. I like the idea of the unique string, however I thought we could solve both points you noted @exodist how about a namespaced style url instead?
As you all are worried about this getting too complex this should definitely be something that isn't always required but should be simple to apply to all tests (That was my original thinking around UUID's where they can be unique per rerun because of UUID5 and also all tests will have a description but might not have a unique token or namespace). As mentioned in #13 we should avoid the use of specific implementations like environment variables. Not all implementations will choose to implement code that way as they may not be exposed to environment variables. However I would like this feature something that producers can turn on - the only problem with that would be that consumers that are also producers would not be able to add more information. |
Quite frankly, I think this proposal is unworkable. The complication for the parser to detangle this afterwards is much higher than the complication would be for the producer to produce something coherent in the first place. If one really wants concurrent testing, the sensible thing is to do is to have multiple TAP streams, not to multiplex them. |
@Leont multiple TAP streams would need to be multiplexed at some point to be consumed surely, suffering from a similar issue. |
@jonathanKingston I sure hope someone doesn't ask for that... |
@beatgammit the suggestion was supposed to be a work around for a genuine use-case; the work around needs to handle that. |
The new TAP should have explicit concurrency support, that is where TAP can be generated via multiple threads.
Note: For most things there is no guarantee of atomic writes, but that is not TAP's problem, so lets skip over that and assume that the generator will only let 1 child write at a time, but allow children to write lines inter-weaved.
One simple thing to do is #14 which simply makes test order unimportant so long as no numbers are completely missing. This solves the problem for basic ok's. This can also solve the problem for #2 if we use the 1.2.3 syntax. However if we do not have numbers enabled we loose the gains as subtest results are no longer easily linked to their subtest in a concurrent producer.
In #2 I suggested the ability to prefix any line of output with a test number followed by a colon... but this fails to solve the concurrency problem when test numbers are turned off.
I got a suggestion from someone that we use thread/proc ids. So here is a proposal:
Essentially the proposal is this: ANY line of output can be prefixed by a sequence starting with a single letter, followed by only digits then ended with whitespace. All lines with the same prefix are associated. No prefix is the default prefix, and all lines with no prefix are grouped.
Another thing I added here is the subtest plan prefixed with an 's'. I will mention this possibility in #2 shortly.
The text was updated successfully, but these errors were encountered: