Closed Bug 1241618 Opened 8 years ago Closed 8 years ago

Sporadic test failures in is_percentage

Categories

(Socorro :: Webapp, task)

task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: peterbe, Assigned: peterbe)

Details

Attachments

(1 file)

I've seen this at least once in Travis and I just today saw it happen on my laptop. 

The test that test the Crashes per Day CSV data uses a random function. So you might get a number like this: `0.0%` in the CSV file. 
The function we use to assert that it is a percentage number looks like this::

def is_percentage(thing):
    return thing.endswith('%') and float(thing.replace('%', ''))

So, if `thing` is `'0.0%'` this function will return False.
Assignee: nobody → peterbe
Commits pushed to master at https://github.com/mozilla/socorro

https://github.com/mozilla/socorro/commit/ccdea57a4f034f3c674199c5ff29327ab431d00d
fixes bug 1241618 - Sporadic test failures in is_percentage

https://github.com/mozilla/socorro/commit/2d66d1612c5936759820607a54bc0a7beec48ad5
Merge pull request #3170 from peterbe/bug-1241618-sporadic-test-failures-in-is_percentage

fixes bug 1241618 - Sporadic test failures in is_percentage
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: