./manage.py test returns incorrect status code if more than 255 bugs fail
|Reported by:||Chris Lamb||Owned by:||Gary Wilson|
|Cc:||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
The Django test runner currently calls "sys.exit(number_of_failed_tests)" when finished. However, as exit codes under UNIX (etc.) systems are unsigned chars, if n % 256 == 0 bugs fail (where n > 0) the exit code for the program is 0 - ie. incorrectly denoting a "successful" build run.
A more general problem exists where, if n > 256 bugs fail, the exit code is actually modulus 256 the number of failed tests.
A patch is attached which normalises the values to either 0 and 1 on success and failure respectfully - we cannot return the number in this manner, so let's not pretend to.
Change History (8)
comment:1 Changed 7 years ago by
|Patch needs improvement:||unset|
|Triage Stage:||Unreviewed → Accepted|