jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dominique Pfister (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (JCR-3743) failing test if aws extensions
Date Tue, 18 Mar 2014 13:55:44 GMT

    [ https://issues.apache.org/jira/browse/JCR-3743?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13939210#comment-13939210

Dominique Pfister commented on JCR-3743:

bq. You'll have to check the code for any assumptions of System.currentTimeMillis having a
better granularity than 20ms. For instance, the assert on getLastModified being > updateTime
looks fishy.

The test fails since {{rec1}}'s last modified time hasn't been updated, although the record
was accessed some lines _after_ updateModifiedDateOnAccess() was called:
long updateTime = System.currentTimeMillis();

data = new byte[dataLength];
DataRecord rec3 = ds.addRecord(new ByteArrayInputStream(data));

data = new byte[dataLength];
DataRecord rec4 = ds.addRecord(new ByteArrayInputStream(data));

rec1 = ds.getRecord(rec1.getIdentifier());

So your reasoning implies that adding the 2 DataRecords {{rec3}} and {{rec4}} takes less than
20ms? If this would be the case, I'd split the sleep of 2000 ms into two sleeps of 1000 ms
each, and have the second one put after obtaining the {{updateTime}} above.

> failing test if aws extensions
> ------------------------------
>                 Key: JCR-3743
>                 URL: https://issues.apache.org/jira/browse/JCR-3743
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>            Reporter: Julian Reschke
>            Assignee: Dominique Pfister
>            Priority: Minor
> On Win7/64bit/corei7:
> Failed tests:
>   testDeleteAllOlderThan(org.apache.jackrabbit.aws.ext.ds.TestInMemDs)
>   testDeleteAllOlderThan(org.apache.jackrabbit.aws.ext.ds.TestInMemDsCacheOff)
> Likely because of incorrect assumptions about System.currentTimeMillis()

This message was sent by Atlassian JIRA

View raw message