You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Roman Puchkovskiy (Jira)" <ji...@apache.org> on 2024/12/13 12:04:00 UTC

[jira] [Updated] (IGNITE-23858) FreeListImplTest#testMultiThread is flaky

     [ https://issues.apache.org/jira/browse/IGNITE-23858?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Roman Puchkovskiy updated IGNITE-23858:
---------------------------------------
    Labels: ignite-3  (was: )

> FreeListImplTest#testMultiThread is flaky
> -----------------------------------------
>
>                 Key: IGNITE-23858
>                 URL: https://issues.apache.org/jira/browse/IGNITE-23858
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Daniella Hubble
>            Priority: Minor
>              Labels: ignite-3
>   Original Estimate: 10m
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> The `FreeListImplTest#testMultiThread` test intermittently fails due to non-deterministic behavior. The issue was identified using [NonDex|[https://github.com/TestingResearchIllinois/NonDex] ], a tool designed to detect flaky tests by introducing non-deterministic order in the execution of methods that rely on unordered collections or concurrency. 
> To reproduce:
> 1) Set up NonDex for the project.
> 2) Run the following command './gradlew :ignite-page-memory:nondexTest --tests=FreeListImplTest.testMultiThread'
> 3) Observe the intermittent test failure:
> {code:java}
> > Task :ignite-page-memory:nondexTestFreeListImplTest > testMultiThread(int, boolean) > [1] 1024, true FAILED
>     java.util.concurrent.TimeoutException at FreeListImplTest.java:116
>  {code}
> The flaky behavior appears to be caused by the nondeterministic nature of 'ConcurrentHashMap'. Since thread execution order can vary, this may lead to inconsistent states, causing the test to hang or time out.
>  
> Fix:
> When the 'ConcurrentHashMap' is replaced with a 'ConcurrentSkipListMap', the test consistently passes in both normal execution (using command: './gradlew :ignite-page-memory:test --tests=FreeListImplTest.testMultiThread') and under NonDex testing (using command: './gradlew :ignite-page-memory:nondexTest --tests=FreeListImplTest.testMultiThread'). This is because 'ConcurrentSkipListMap' maintains a predictable order for elements, reducing the potential for inconsistent states in concurrent operations.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)