Use microtime instead of float for user deletion

Bug #841723 reported by Andrew Nicols
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Wishlist
Andrew Nicols

Bug Description

For unit testing, or scripted user management for that matter, there may be the need to create and remove the same user multiple times over a short period. The current deletion method is to alter the username and e-mail address to suffix deleted.time()
Time isn't precise enough and you end up with collisions.

Changing to use microtime fixes these issues and allows for unit tests to be run

Revision history for this message
Andrew Nicols (dobedobedoh) wrote :

Commited supplied by Penny: https://reviews.mahara.org/641

Changed in mahara:
status: New → In Progress
importance: Undecided → Wishlist
assignee: nobody → Andrew Nicols (dobedobedoh)
milestone: none → 1.5.0
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/641
Committed: http://gitorious.org/mahara/mahara/commit/0cd0a206b8fc0c0a2b94dc2c0c0dc1ed0bb9c5de
Submitter: Francois Marier (<email address hidden>)
Branch: master

commit 0cd0a206b8fc0c0a2b94dc2c0c0dc1ed0bb9c5de
Author: Penny Leach <email address hidden>
Date: Sun Aug 23 15:10:35 2009 +0200

    Bug #841723: Increase precision of user deletion times

    Delete user: use microtime() (float) instead of time() for username & email

    This prevents collisions when a username with the same details being
    deleted in the same second (which happens when tests are running)

    Change-Id: I1fe53d0e3904b3a2658aea9e00434b767cc1e0d0
    Signed-off-by: Penny Leach <email address hidden>

Changed in mahara:
status: In Progress → Fix Committed
Revision history for this message
Melissa Draper (melissa) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

 status fixreleased
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJPjrYkAAoJECXBtiziiXdcBjUH+gOs1qGQ20HFISw5maAWKxaU
yT4JUSRYzcVk8g5FgnONKIDVMKo9ZiyZD0xTWoevwRamE5IiE00ltsoxtaVecvBx
Km/hOBIiaTCfNlZ/nCULO+FUflYWhuzjb8szGQNCLTJLXzHq1Q/BRJAWPzKvUweo
zKe23pNiXtMlRkqEs+IwWnf04M3YH8O6tqcoirtLWPmLRJxtW19qT5LOGdkFojVP
ode3BhogyPMFWxS9mhn0AgE9j/GdNMXbPxKCSqLhrcDCQvC+wXNqvWC/Fp7jMe0n
5mPXBmBPLCiQAIQ7a9GNV/71GhLEB6YkZ1HZj+EkCuXvdejKe/MutEVgHIiZUus=
=Yjja
-----END PGP SIGNATURE-----

Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.