Posted by sun on May 3, 2012 at 11:08pm
10 followers
| Project: | Drupal core |
| Version: | 7.x-dev |
| Component: | simpletest.module |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
| Issue tags: | Testing system |
Issue Summary
Problem
- Maintainers and developers are confused about varying positive test assertion counts for patches passing tests.
Goal
- Ensure that assertion counts can be trusted.
Details
- Running the same test suite on the same machine can yield a difference of hundreds assertions.
- The difference is caused by various tests that use
rand(1, 10)for their initial setup (which means that test assertions are exponentially increasing for each additional item).
Solution
- Remove all calls to
rand()from all tests.
Comments
#1
Incidentally, we should not remove *all* calls to rand() (or mt_rand()) from simpletests as most of them are used to set a random weight, languagecode, chr, etc... We only need to remove those calls that case an inconsistent number of assertions.
In fact, I only found three places where rand() is used in such a way that there are random assertions.
#2
Awesome, thanks!
#3
The last submitted patch, 1560028.patch, failed testing.
#4
this should fix that errr
#5
here testbot .. here boy
#6
#7
#4: 1560028.patch queued for re-testing.
#8
The last submitted patch, 1560028.patch, failed testing.
#9
#10
Committed to 8.x. Thanks!
#11
#12
Thanks @thehong! :)
#13
Committed to 7.x - thanks! http://drupalcode.org/project/drupal.git/commit/e0961c9
#14
Automatically closed -- issue fixed for 2 weeks with no activity.