-
-
Notifications
You must be signed in to change notification settings - Fork 161
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
aruba 0.3.2 fails features (stdout buffering issue?) #48
Comments
If you're seeing failures like this with your own features, can you post an example like the above but include the relevant scenario (or scenarios) and code from your own project? This is the first time I've seen an error like this, and that might help narrow it down. |
I have not tried to write my own code yet, I'm only trying to run aruba's own features. It seems to me to be a really simple test case already since it only involves calling out to ruby. |
I can also reproduce this with aruba HEAD. The problem is that @processes in aruba/api.rb is a Hash, and thus in all_stderr no ordering is guaranteed in ruby 1.8.7 and my ruby picks the "wrong" order. One way to fix this is would be to add a @started_at timestamp to aruba/process.rb and use that to sort. The real underlying problem seems to be that the output code doesn't multiplex the different streams, so if applications output different things at different times the output still won't be accurately reflected in aruba. Fixing that would also solve this issue. |
What about storing the processes as an array of [name, process] arrays, and searching for them that way? That's pretty simple, and will keep order of operations on the processes deterministic when we need to do something to all of them. Care to submit a patch? |
I can confirm this issue, I work around this by adding this step to my
If you see this error:
Make sure your feature description does this:
|
@hedgehog How do you use that code to modify the behavior graaff is seeing? |
To match a command with the output from that command. @graaff is seeing the side effect of Aruba's method of joining output contents from multiple commands. This raises your point: Can/should Aruba guarantee the output from separate I say no, no, no, no. OR: Consider adding a This will then make unambiguous that the multiple commands case needs to be treated differently. |
@hedgehog I like the idea of running a list of commands in series, but I think that's a bit more complex than is called for at the moment. Right now there's a failing test, and I think it would be best to get that fixed before considering new features. Whether Aruba should have more complex opinions about the order of IO reads is a discussion for a different ticket, don't you think? |
@msassak, that is the point, the example is failing simply becasue it describes behavior that Aruba doesn't (shouldn't) promise (or try) to deliver: output order by in runlist exec time. You'll see in the pull request I take this into account: No? |
I don't think that's the case. The example is failing because the implementation of the Hash class in 1.9 differs from its implementation in 1.8. The steps for detecting multiline output from a named process would be a good addition to Aruba, but I don't see how that is relevant to fixing this bug, or why, in a testing framework, we should choose the non-deterministic behavior over the deterministic one. |
OK. |
Fix pushed here: https://github.com/msassak/aruba/tree/48-ordered-output. I'll send a pull request soon. |
Closed by #61. 0.3.5 released. Thanks Mike! |
I'm getting a few failures like this one with the released version of the aruba 0.3.2 gem. The intend of the feature seems to be fulfilled, just not the order in which the results are shown. I'm not sure to what extend this is considered to be a problem.
This is using "ruby 1.8.7 (2011-02-18 patchlevel 334) [x86_64-linux]". Please let me know if you need more details.
The text was updated successfully, but these errors were encountered: