[foreign-memaccess+abi] Integrated: 8303831: TestSegmentCopy times out

Jorn Vernee jvernee at openjdk.org
Fri Apr 14 13:31:03 UTC 2023


On Thu, 13 Apr 2023 16:23:37 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

> The underlying issue turned out to be that this test generates a lot of test cases, 165890, which TestNG then spends forever generating an XML report for.
> 
> This patch refactors the test to generate less test cases. Instead of generating all the combinations of slices up front in the data provider, it is done on the fly in the test methods themselves.
> 
> Additionally, this patch improves the space that is covered. The current code tests copies between disjoint slices of the same segment. The new code uses two separate segments, which also allows testing mixes of segment types (heap/off-heap).
> 
> The current code also uses `asSlice` to generate the slices, but it seems more interesting to pass the offset of a slice directly to MemorySegment::copy, so that we test with different offsets as well (currently only offset 0 is used). I think we already have enough coverage of `asSlice` in other tests, such as TestSlices.
> 
> Lastly, I've removed the zeroing of the target area/slice. If there's garbage in target slice, we can test that the copy properly overwrites the garbage as well.

This pull request has now been integrated.

Changeset: 8845d713
Author:    Jorn Vernee <jvernee at openjdk.org>
URL:       https://git.openjdk.org/panama-foreign/commit/8845d7133a36da4d4e743a53717a2b60c6cd738f
Stats:     141 lines in 1 file changed: 28 ins; 42 del; 71 mod

8303831: TestSegmentCopy times out

Reviewed-by: mcimadamore

-------------

PR: https://git.openjdk.org/panama-foreign/pull/827


More information about the panama-dev mailing list