You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2019/11/28 10:18:59 UTC

[GitHub] [hadoop-ozone] elek opened a new pull request #278: HDDS-2639. TestTableCacheImpl is flaky

elek opened a new pull request #278: HDDS-2639. TestTableCacheImpl is flaky
URL: https://github.com/apache/hadoop-ozone/pull/278
 
 
   ## What changes were proposed in this pull request?
   
   Run(master): https://github.com/apache/hadoop-ozone/runs/324342299
   
   ```
   -------------------------------------------------------------------------------
   Test set: org.apache.hadoop.hdds.utils.db.cache.TestTableCacheImpl
   -------------------------------------------------------------------------------
   Tests run: 10, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 2.955 s <<< FAILURE! - in org.apache.hadoop.hdds.utils.db.cache.TestTableCacheImpl
   testPartialTableCacheWithOverrideAndDelete[0](org.apache.hadoop.hdds.utils.db.cache.TestTableCacheImpl)  Time elapsed: 0.039 s  <<< FAILURE!
   java.lang.AssertionError: expected:<2> but was:<6>
   	at org.junit.Assert.fail(Assert.java:88)
   	at org.junit.Assert.failNotEquals(Assert.java:743)
   	at org.junit.Assert.assertEquals(Assert.java:118)
   	at org.junit.Assert.assertEquals(Assert.java:555)
   	at org.junit.Assert.assertEquals(Assert.java:542)
   	at org.apache.hadoop.hdds.utils.db.cache.TestTableCacheImpl.testPartialTableCacheWithOverrideAndDelete(TestTableCacheImpl.java:308)
   ```
    
   ### How to reproduce it locally?
   
   Replace the last `tableCache.cleanup` call of `testPartialTableCacheWithOverrideAndDelete` to `System.out.println(tableCache.size())`.
   
   You will see that the cache size is `2` even before the cleanup therefore the next `GeneriTestUtils.waitFor` is useless (it doesn't guarantee that the cleanup is finished).
   
   ### Fix
   
   I propose to call the cleanup sync (instead of async) with using `TableCacheImpl` reference instead of the interface. It simplifies the test but still validates the behavior.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-2639
   
   ## How was this patch tested?
   
   Problem an be reproduced locally as defined above. 
   
   Fix can be tested with executing the `TestTableCacheImpl` unit test.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org