Skip to content

Skip benchmark run depends on the result #313

@akiya-nagatsuka

Description

@akiya-nagatsuka

I want to exclude some benchmark runs if they are invalid.
For example

@State(Scope.Benchmark)
class BenchmarkClass {
    private lateinit var isValid: Boolean

    @Benchmark
    fun benchmark() {
        isValid = runBenchmark()
    }

    @TearDown
    fun tearDown() {
        if (!isValid) throw error("Invalid run")
    }
}

For JVM It works properly. But on MacOS the Gradle task fails with the error thrown in tearDown.
Can I make MacOS runner skip the benchmark run like it's done on JVM. Or I can send any message to benchmark runner that this run should not be counted.

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