Running Go SDK TestStream integration tests on the Flink runner consistently results in the following error on the first test run regardless of the test itself:
This error is thrown on the first test run on a fresh instance of the Flink job server; subsequent test runs of the same suite pass. Stopping the job server and starting a new one results in the first test run failing again. The memory error is thrown for int64, float64, and boolean data types; however, if the first TestStream contains strings or byte slices the memory error does not occur. It should be noted that strings and byte slices are getting appended with an extra length prefix on the Flink side, although it is unclear if that is related.
On further investigation, the bug appears to be environment-specific, with many machines unable to reproduce the issue; however, the error still occurs on Jenkins for test runs.