Skip to content

Incorrect reset behavior on some tests #4

@bvisness

Description

@bvisness

We have identified two benchmarks that do not reset correctly, leading to benchmark measurements that increase depending on the number of iterations. This is what we are currently using for our benchmark config:

exclude:microBenchmarks.ArrayCopyBenchmark.copyInSameArray
exclude:microBenchmarks.PrimeListBenchmark.calcEratosthenes

There may be others, but these benchmarks have bad behavior due to infinitely-growing arrays.

The problem, it seems, is that the test harness runs the @Setup and @TearDown functions at the beginning and end of the entire test suite, not per iteration. That is, @Setup runs only once before warmups, and @TearDown runs only once after all measurement iterations. This is, frankly, quite counterintuitive and I wonder if that is just a bug in the harness itself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions