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

Arvid Heise closed FLINK-22876.
-------------------------------
    Resolution: Fixed

> Adding SharedObjects junit rule to ease test development
> --------------------------------------------------------
>
>                 Key: FLINK-22876
>                 URL: https://issues.apache.org/jira/browse/FLINK-22876
>             Project: Flink
>          Issue Type: Improvement
>          Components: Test Infrastructure
>    Affects Versions: 1.14.0
>            Reporter: Arvid Heise
>            Assignee: Arvid Heise
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.14.0
>
>
> Most test rely on static variables to sync between test code and UDFs to 
> avoid serialization issues. However, static variables are error-prone and the 
> tests look quaint.
>  SharedObjects allow test developers to forget about the serialization and 
> just use the objects across thread boundaries.
> The main idea is that shared objects are bound to the scope of a test case 
> instead of a class. That allows us to:
>  * get rid of all nasty reset methods for reused parts and most importantly 
> avoid test bugs that result in us forgetting to reset (think of a latch in a 
> shared WaitingSink)
>  * it’s easier to reason about the test setup
>  * it will allow us to share more code and provide more primitives (e.g. have 
> some canonical way to wait for certain events)
>  * run tests in parallel that reuse classes depending on shared objects
>  * it will also be significantly easier to write tests for contributors.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to