Package: haskell-token-bucket / 0.1.0.1-11

Metadata

Package Version Patches format
haskell-token-bucket 0.1.0.1-11 3.0 (quilt)

Patch series

view the series file
Patch File delta Description
newer deps | (download)

token-bucket.cabal | 19 13 + 6 - 0 !
1 file changed, 13 insertions(+), 6 deletions(-)

---
fix test timing | (download)

test-tb.hs | 21 10 + 11 - 0 !
1 file changed, 10 insertions(+), 11 deletions(-)

 resolve timing issue in the test
  Creating the TokenBucket far away from the actual tests means that
  the TokenBucket can accumulate a partial token before the start time
  for the first test is taken. After the first requested token
  exhausts the burst size it doesn't take the full time that would
  usually be required before the second token can be allocated. Most
  of the time this doesn't seem to be a problem, but on some
  architectures (armhf, mipsel) it seems to cause semi-consistent test
  failurses. Strictly speaking the same problem still exists with this
  patch, as the TokenBucket is still created before the start time of
  the test is taken, but with the current layout this inaccuracy
  usually balances out with the time added at the end, because the end
  time of the test is taken slightly after the last token is
  allocated.
  This also fixes that the test was overly lenient for all but the
  first test. All test are run with n+1 iterations to account for the
  initial burst token contained in the freshly created bucket, but
  only the first test gets to actually allocate that token. All others
  have to wait for a new token to be generated.
  This patch has not been forwarded to upstream yet, because at the
  time of writing it, I did not have access to my GitHub account. One
  I have I will (hopefully) forward it in a timely manner.
Bug: https://github.com/haskell-hvr/token-bucket/issues/3
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=867858