Details
Description
I'll attach a file with a test that I would expect to pass but which fails.
It creates five PCollection<String> of lengths 0, 1, 2, 3, 4 gets the lengths, runs the pipeline and prints the lengths. Finally it asserts that all lengths are non-null.
I would expect it to print lengths 0, 1, 2, 3, 4 and pass.
What it does is print lengths null, null, null, 3, 4 and fail.
I think the underlying reason is the use of getSize() on an unmaterialized object and assuming that when the estimate that getSize() returns is 0, then the PCollection is guaranteed to be empty, which is false in some cases.