harshilv17 opened a new pull request, #41724: URL: https://github.com/apache/beam/pull/41724
Fixes #18458. Ports the windowing tests off `WindowFnTestUtils.runWindowFn`, whose expected maps of windows to `"T<timestamp>"` strings made it hard to see what each test checks. - `FixedWindowsTest`, `SlidingWindowsTest`, `CalendarWindowsTest`: each test now asserts the windows `assignedWindows` returns for each timestamp. Timestamps that land in no window, like 3, 5 and 9 in `SlidingWindowsTest.testElidings`, are now asserted explicitly; the old map could only leave them out. - `SessionsTest`: merging is the behavior under test, so it keeps a small local helper that assigns each timestamp, merges after each one, and returns the sessions with the timestamps they hold, compared against an `ImmutableMap` of windows to timestamps. - `runWindowFn`, `runWindowFnWithValue` and `set` are public in `beam-sdks-java-core`, so they are marked `@Deprecated` (pointing at `assignedWindows`) rather than removed. No other module uses them. The expected windows are the same as before: the per-timestamp assertions were generated from the old expected maps. Ran `FixedWindowsTest`, `SlidingWindowsTest`, `CalendarWindowsTest` and `SessionsTest` (42 tests) locally with JDK 17; `spotlessCheck`, `checkstyleMain` and `checkstyleTest` are clean. Changing an expected window, or the timestamps of a session, makes the matching test fail. - [x] Small/focused contribution (ICLA not required). - [x] Mentions the issue (`Fixes #18458`). - [x] `CHANGES.md`: deprecation entry added. -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
