Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-4552

Refactor WindowOperator/Trigger Tests

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.2.0, 1.3.0
    • Component/s: DataStream API
    • Labels:
      None

      Description

      Right now, tests for WindowOperator, WindowAssigner, Trigger and WindowFunction are all conflated in WindowOperatorTest. All of these test that a certain combination of a Trigger, WindowAssigner and WindowFunction produce the expected output.

      We should modularize these tests and spread them out across multiple files, possibly one per trigger, for the triggers. Also, we should extend/change the tests in some key ways:

      • WindowOperatorTest test should just verify that the interaction between WindowOperator and the various other parts works as expected, that the correct methods on Trigger and WindowFunction are called at the expected time and that snapshotting, timers, cleanup etc. work correctly. These tests should also verify that the different state types and WindowFunctions work correctly.
      • Trigger tests should present elements to triggers and verify that they fire at the correct times. The actual output of the WindowFunction is not important for these tests. We should also test that triggers correctly clean up state and timers.
      • WindowAssigner tests should test each window assigner and also verify that, for example, the offset parameter of time-based windows works correctly.

      There is already WindowingTestHarness but it is not used by tests, I think we can expand on that and provide more thorough test coverage while also making the tests more maintainable (WindowOperatorTest.java is nearing 3000 lines of code).

        Attachments

        There are no Sub-Tasks for this issue.

          Activity

            People

            • Assignee:
              aljoscha Aljoscha Krettek
              Reporter:
              aljoscha Aljoscha Krettek
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: