From e74d7a562b4dcad212d7abadc8cb155c2d15df16 Mon Sep 17 00:00:00 2001 From: arcuri82 Date: Thu, 28 Sep 2023 10:54:10 +0200 Subject: [PATCH 1/2] failing assertion --- core/src/main/kotlin/org/evomaster/core/Main.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/core/src/main/kotlin/org/evomaster/core/Main.kt b/core/src/main/kotlin/org/evomaster/core/Main.kt index 3912ce4895..25cb2a0cdb 100644 --- a/core/src/main/kotlin/org/evomaster/core/Main.kt +++ b/core/src/main/kotlin/org/evomaster/core/Main.kt @@ -232,6 +232,7 @@ class Main { when(config.problemType){ EMConfig.ProblemType.REST -> { val k = data.find { it.header == Statistics.COVERED_2XX }!!.element.toInt() + assert(k <= n) val p = String.format("%.0f", (k.toDouble()/n) * 100 ) info("Successfully executed (HTTP code 2xx) $k endpoints out of $n ($p%)") } From 3bf6d5068ec027f8d61594bc86be4fa8860791f5 Mon Sep 17 00:00:00 2001 From: arcuri82 Date: Thu, 28 Sep 2023 12:51:56 +0200 Subject: [PATCH 2/2] tmp fix for 2xx coverage log issue --- core/src/main/kotlin/org/evomaster/core/Main.kt | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/core/src/main/kotlin/org/evomaster/core/Main.kt b/core/src/main/kotlin/org/evomaster/core/Main.kt index 25cb2a0cdb..d77f7a469e 100644 --- a/core/src/main/kotlin/org/evomaster/core/Main.kt +++ b/core/src/main/kotlin/org/evomaster/core/Main.kt @@ -168,6 +168,7 @@ class Main { val solution = run(injector, controllerInfo) val faults = solution.overall.potentialFoundFaults(idMapper) + val sampler : Sampler<*> = injector.getInstance(Key.get(object : TypeLiteral>(){})) resetExternalServiceHandler(injector) @@ -232,9 +233,18 @@ class Main { when(config.problemType){ EMConfig.ProblemType.REST -> { val k = data.find { it.header == Statistics.COVERED_2XX }!!.element.toInt() - assert(k <= n) - val p = String.format("%.0f", (k.toDouble()/n) * 100 ) - info("Successfully executed (HTTP code 2xx) $k endpoints out of $n ($p%)") + val t = if (sampler.getPreDefinedIndividuals().isNotEmpty()) { + /* + FIXME this is a temporary hack... + right now we might have 1 call to Schema that messes up this statistics + */ + n + 1 + } else { + n + } + assert(k <= t) + val p = String.format("%.0f", (k.toDouble()/t) * 100 ) + info("Successfully executed (HTTP code 2xx) $k endpoints out of $t ($p%)") } EMConfig.ProblemType.GRAPHQL ->{ val k = data.find { it.header == Statistics.GQL_NO_ERRORS }!!.element.toInt()