[ 
https://issues.apache.org/jira/browse/HBASE-6476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13449433#comment-13449433
 ] 

Lars Hofhansl commented on HBASE-6476:
--------------------------------------

Hmm... Tests are *precisely* the place where you want to control time (i.e. not 
real time), so you do not need to write time dependent tests. And this 
specifically true to random number generation, so you get a predictable (or at 
least identical on each run) sequence of random numbers.

Now, maybe in some cases you actually have to make you won't get the same 
random for each run, but by default you get the real time; so you just don't 
override the default EnvironmentEdge.

I'm confused now.

                
> Replace all occurrances of System.currentTimeMillis() with EnvironmentEdge 
> equivalent
> -------------------------------------------------------------------------------------
>
>                 Key: HBASE-6476
>                 URL: https://issues.apache.org/jira/browse/HBASE-6476
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Lars Hofhansl
>            Assignee: Lars Hofhansl
>            Priority: Minor
>             Fix For: 0.96.0
>
>         Attachments: 6476.txt, 6476-v2.txt, 6476-v2.txt
>
>
> There are still some areas where System.currentTimeMillis() is used in HBase. 
> In order to make all parts of the code base testable and (potentially) to be 
> able to configure HBase's notion of time, this should be generally be 
> replaced with EnvironmentEdgeManager.currentTimeMillis().
> How hard would it be to add a maven task that checks for that, so we do not 
> introduce System.currentTimeMillis back in the future?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to