Improve test suite to be less fragile #290
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This simple PR improves the test suite to use less fragile assumptions for the functional tests and also resets test doubles between test runs to ensure the test suite supports running with
--repeat=100
.Also, the old test suite did report an error when using
ext-event
, both locally and when run on Travis. Note that this project currently only tests against the "default loop", so this wasn't reported here, but actually as part of reactphp/reactphp#396 (comment). Accordingly, it's worth considering running against multiple loop implementations, but I'll try to leave this discussion separated from this PR.The updated test suite avoids assumptions about the loop tick behavior and the number of tests runs and thus makes these tests less fragile.
Refs reactphp/event-loop#144