Skip to content

Fuzzer doesn't generate anything when given many recursive seeds #2434

@IlyaMuravjov

Description

@IlyaMuravjov

Description

Fuzzer doesn't generate any values when given 100 recursive seeds, even though Configuration.recursionTreeDepth is kept at default value (i.e. 4).

Note: fuzzer doesn't need to explore all $100^4$ combinations to produce something, it can explore any single one of them and that will already be enough to produce one value.

Real world example

When using static methods for creating values is supported, there will be 50 seeds for generating java.time.LocalDateTime type, most of which require another instance of java.time.LocalDateTime or some other type that also has a lot of static methods that can create it.

To Reproduce

Run the following unit test.

@Test
@Timeout(10, unit = TimeUnit.SECONDS) // withTimeout(1000) works inconsistently
fun `fuzzer works when there are many recursive seeds`() {
    class Node(val parent: Node?)
    runBlocking {
        var seenAnything = false
        withTimeout(1000) {
            runFuzzing(
                { _, _ -> List(100) {Seed.Recursive<Unit, Node?>(
                    construct = Routine.Create(listOf(Unit)) { (parent) -> Node(parent) },
                    modify = emptySequence(),
                    empty = Routine.Empty { null }
                )}.asSequence() },
                Description(listOf(Unit))
            ) { _, _ ->
                seenAnything = true
                BaseFeedback(Unit, Control.STOP)
            }
        }
        assertTrue(seenAnything) { "Fuzzer hasn't generated any values" }
    }
}

Expected behavior
Test passes.

Actual behavior
Test fails.

Visual proofs (screenshots, logs, images)

fuzzer works when there are many recursive seeds() timed out after 10 seconds

Metadata

Metadata

Assignees

Labels

comp-fuzzingIssue is related to the fuzzingctg-bugIssue is a bug

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions