Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Fix Faker again #4225

Merged
merged 1 commit into from
Dec 8, 2016
Merged

Fix Faker again #4225

merged 1 commit into from
Dec 8, 2016

Conversation

chadwhitacre
Copy link
Contributor

First attempt in #4224 didn't work: #4221 (comment).

@chadwhitacre chadwhitacre changed the title Fixing Faker again Fix Faker again Dec 7, 2016
@chadwhitacre chadwhitacre mentioned this pull request Dec 7, 2016
4 tasks
@chadwhitacre
Copy link
Contributor Author

chadwhitacre commented Dec 7, 2016

It would seem that we're passing in a start date in the future, since end_date defaults to now.

        if step == 1:
>           raise ValueError, "empty range for randrange() (%d,%d, %d)" % (istart, istop, width)
E           ValueError: empty range for randrange() (1481258996,1481141523, -117473)
/opt/python/2.7.12/lib/python2.7/random.py:218: ValueError

https://travis-ci.org/gratipay/gratipay.com/builds/182073772

Reviewing joke2k/faker#282 ...

@chadwhitacre
Copy link
Contributor Author

[gratipay] $ date -j -r 1481258996
Thu Dec  8 23:49:56 EST 2016
[gratipay] $ date -j -r 1481141523
Wed Dec  7 15:12:03 EST 2016
[gratipay] $

@chadwhitacre
Copy link
Contributor Author

[gratipay] $ date
Wed Dec  7 16:44:28 EST 2016
[gratipay] $

@chadwhitacre
Copy link
Contributor Author

It looks like the end date is accurate (did that build really run 90 minutes ago?).

@chadwhitacre
Copy link
Contributor Author

foo

@chadwhitacre
Copy link
Contributor Author

Yes: 2016-12-07T20:12:41Z.

@chadwhitacre
Copy link
Contributor Author

chadwhitacre commented Dec 7, 2016

(EST is UTC-5.)

@chadwhitacre
Copy link
Contributor Author

Alright, so end_date is fine. What's up with start_date?

@chadwhitacre
Copy link
Contributor Author

The range on joke2k/faker#282 is different: (0,-10325, -10325).

@chadwhitacre
Copy link
Contributor Author

Alright, so where do participant.claimed_time and team.ctime come from?

@chadwhitacre
Copy link
Contributor Author

Huh ... participant.claimed_time is calculated as seven days after ctime, which is a random time between three years ago and now. So if ctime ends up within the last week, that would put start_date in the future. Whatever team.ctime is would need to be even further in the future to be preferred—but nonetheless where does that come from?

@chadwhitacre
Copy link
Contributor Author

As it happens though, team.ctime is also seven days after the owner's ctime. Participant is not the team owner.

@chadwhitacre
Copy link
Contributor Author

chadwhitacre commented Dec 7, 2016

How about 216ad15 545eb59, @mattbk @kaguillera?

@chadwhitacre
Copy link
Contributor Author

@chadwhitacre chadwhitacre force-pushed the fix-fake-payment-instruction-again branch from 216ad15 to f900240 Compare December 7, 2016 22:16
@chadwhitacre chadwhitacre force-pushed the fix-fake-payment-instruction-again branch from f900240 to 545eb59 Compare December 7, 2016 22:17
Copy link
Contributor

@mattbk mattbk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logic makes sense to me.

@chadwhitacre chadwhitacre merged commit 10351a2 into master Dec 8, 2016
@chadwhitacre chadwhitacre deleted the fix-fake-payment-instruction-again branch December 8, 2016 10:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants