Description
Since #2583 fuzzer is able to construct quite complex arguments for method under test, that can take quite some time to actually create, while instrumnted-process marks executions as timed out even if the thing that actually timed out is the argument creation prior to method under test invocation.
To Reproduce
publicstaticbooleanisNull(CharSequencecharSequence) {
if (charSequence == null) returntrue;
elsereturnfalse;
}Expected behavior
Two successful test and no time out test.
Actual behavior
Two successful test and 10 time out test.
Visual proofs
publicfinalclassClassUnderTestTest {
///region Test suites for executable org.example.ClassUnderTest.isNull///region FUZZER: SUCCESSFUL EXECUTIONS for method isNull(java.lang.CharSequence)/** * @utbot.classUnderTest {@link ClassUnderTest} * @utbot.methodUnderTest {@link ClassUnderTest#isNull(CharSequence)} */@Test@DisplayName("isNull: arg_0 = null -> return true")
publicvoidtestIsNullReturnsTrue() {
booleanactual = ClassUnderTest.isNull(null);
assertTrue(actual);
}
/** * @utbot.classUnderTest {@link ClassUnderTest} * @utbot.methodUnderTest {@link ClassUnderTest#isNull(CharSequence)} */@Test@DisplayName("isNull: arg_0 = '10\uFFFC' (mutated from '10') -> return false")
publicvoidtestIsNullReturnsFalseWithNonEmptyString() {
booleanactual = ClassUnderTest.isNull("10\uFFFC");
assertFalse(actual);
}
///endregion///region FUZZER: TIMEOUTS for method isNull(java.lang.CharSequence)/** * @utbot.classUnderTest {@link ClassUnderTest} * @utbot.methodUnderTest {@link ClassUnderTest#isNull(CharSequence)} */@Test@DisplayName("isNull: arg_0 = InetAddress.getCanonicalHostName()")
@Timeout(value = 1000L, unit = TimeUnit.MILLISECONDS)
publicvoidtestIsNull() throwsUnknownHostException {
byte[] byteArray = {Byte.MIN_VALUE, Byte.MIN_VALUE, Byte.MIN_VALUE, Byte.MIN_VALUE};
InetAddressinetAddress = getByAddress(byteArray);
byte[] byteArray1 = {Byte.MIN_VALUE, Byte.MIN_VALUE, Byte.MIN_VALUE, Byte.MIN_VALUE, Byte.MIN_VALUE};
inetAddress.getByAddress(byteArray1);
inetAddress.getLocalHost();
inetAddress.getByName("");
byte[] byteArray2 = {Byte.MIN_VALUE, (byte) 0, (byte) -1};
inetAddress.getByAddress("-3", byteArray2);
inetAddress.getLoopbackAddress();
StringcharSequence = inetAddress.getCanonicalHostName();
/* This execution may take longer than the 1000 ms timeout and therefore fail due to exceeding the timeout. */assertTimeoutPreemptively(Duration.ofMillis(1000L), () -> ClassUnderTest.isNull(charSequence));
}
/** * @utbot.classUnderTest {@link ClassUnderTest} * @utbot.methodUnderTest {@link ClassUnderTest#isNull(CharSequence)} */@Test@DisplayName("isNull: arg_0 = InetAddress.getCanonicalHostName()")
@Timeout(value = 1000L, unit = TimeUnit.MILLISECONDS)
publicvoidtestIsNull1() throwsUnknownHostException {
byte[] byteArray = {Byte.MIN_VALUE, Byte.MIN_VALUE, Byte.MIN_VALUE, Byte.MIN_VALUE};
InetAddressinetAddress = getByAddress(byteArray);
byte[] byteArray1 = {Byte.MIN_VALUE, Byte.MIN_VALUE, Byte.MIN_VALUE, Byte.MIN_VALUE, Byte.MIN_VALUE};
inetAddress.getByAddress(byteArray1);
inetAddress.getLocalHost();
inetAddress.getByName("");
byte[] byteArray2 = {Byte.MIN_VALUE, (byte) 0, (byte) -1};
inetAddress.getByAddress("-3", byteArray2);
inetAddress.getLoopbackAddress();
StringcharSequence = inetAddress.getCanonicalHostName();
/* This execution may take longer than the 1000 ms timeout and therefore fail due to exceeding the timeout. */assertTimeoutPreemptively(Duration.ofMillis(1000L), () -> ClassUnderTest.isNull(charSequence));
}
/** * @utbot.classUnderTest {@link ClassUnderTest} * @utbot.methodUnderTest {@link ClassUnderTest#isNull(CharSequence)} */@Test@DisplayName("isNull: arg_0 = InetAddress.getCanonicalHostName()")
@Timeout(value = 1000L, unit = TimeUnit.MILLISECONDS)
publicvoidtestIsNull2() throwsUnknownHostException {
byte[] byteArray = {Byte.MIN_VALUE, Byte.MIN_VALUE, Byte.MIN_VALUE, Byte.MIN_VALUE};
InetAddressinetAddress = getByAddress(byteArray);
inetAddress.getByName("");
StringcharSequence = inetAddress.getCanonicalHostName();
/* This execution may take longer than the 1000 ms timeout and therefore fail due to exceeding the timeout. */assertTimeoutPreemptively(Duration.ofMillis(1000L), () -> ClassUnderTest.isNull(charSequence));
}
/** * @utbot.classUnderTest {@link ClassUnderTest} * @utbot.methodUnderTest {@link ClassUnderTest#isNull(CharSequence)} */@Test@DisplayName("isNull: arg_0 = InetAddress.getCanonicalHostName()")
@Timeout(value = 1000L, unit = TimeUnit.MILLISECONDS)
publicvoidtestIsNull3() throwsUnknownHostException {
byte[] byteArray = {Byte.MIN_VALUE, Byte.MIN_VALUE, Byte.MIN_VALUE, Byte.MIN_VALUE};
InetAddressinetAddress = getByAddress(byteArray);
StringcharSequence = inetAddress.getCanonicalHostName();
/* This execution may take longer than the 1000 ms timeout and therefore fail due to exceeding the timeout. */assertTimeoutPreemptively(Duration.ofMillis(1000L), () -> ClassUnderTest.isNull(charSequence));
}
/** * @utbot.classUnderTest {@link ClassUnderTest} * @utbot.methodUnderTest {@link ClassUnderTest#isNull(CharSequence)} */@Test@DisplayName("isNull: arg_0 = InetAddress.getCanonicalHostName()")
@Timeout(value = 1000L, unit = TimeUnit.MILLISECONDS)
publicvoidtestIsNull4() throwsUnknownHostException {
byte[] byteArray = {Byte.MIN_VALUE, Byte.MIN_VALUE, Byte.MIN_VALUE, Byte.MIN_VALUE};
InetAddressinetAddress = getByAddress(byteArray);
StringcharSequence = inetAddress.getCanonicalHostName();
/* This execution may take longer than the 1000 ms timeout and therefore fail due to exceeding the timeout. */assertTimeoutPreemptively(Duration.ofMillis(1000L), () -> ClassUnderTest.isNull(charSequence));
}
/** * @utbot.classUnderTest {@link ClassUnderTest} * @utbot.methodUnderTest {@link ClassUnderTest#isNull(CharSequence)} */@Test@DisplayName("isNull: arg_0 = InetAddress.getCanonicalHostName()")
@Timeout(value = 1000L, unit = TimeUnit.MILLISECONDS)
publicvoidtestIsNull5() throwsUnknownHostException {
byte[] byteArray = {Byte.MIN_VALUE, Byte.MIN_VALUE, Byte.MIN_VALUE, Byte.MIN_VALUE};
InetAddressinetAddress = getByAddress(byteArray);
StringcharSequence = inetAddress.getCanonicalHostName();
/* This execution may take longer than the 1000 ms timeout and therefore fail due to exceeding the timeout. */assertTimeoutPreemptively(Duration.ofMillis(1000L), () -> ClassUnderTest.isNull(charSequence));
}
/** * @utbot.classUnderTest {@link ClassUnderTest} * @utbot.methodUnderTest {@link ClassUnderTest#isNull(CharSequence)} */@Test@DisplayName("isNull: arg_0 = InetAddress.getCanonicalHostName()")
@Timeout(value = 1000L, unit = TimeUnit.MILLISECONDS)
publicvoidtestIsNull6() throwsUnknownHostException {
byte[] byteArray = {Byte.MIN_VALUE, Byte.MIN_VALUE, Byte.MIN_VALUE, Byte.MIN_VALUE};
InetAddressinetAddress = getByAddress(byteArray);
StringcharSequence = inetAddress.getCanonicalHostName();
/* This execution may take longer than the 1000 ms timeout and therefore fail due to exceeding the timeout. */assertTimeoutPreemptively(Duration.ofMillis(1000L), () -> ClassUnderTest.isNull(charSequence));
}
/** * @utbot.classUnderTest {@link ClassUnderTest} * @utbot.methodUnderTest {@link ClassUnderTest#isNull(CharSequence)} */@Test@DisplayName("isNull: arg_0 = InetAddress.getCanonicalHostName()")
@Timeout(value = 1000L, unit = TimeUnit.MILLISECONDS)
publicvoidtestIsNull7() throwsUnknownHostException {
byte[] byteArray = {Byte.MIN_VALUE, Byte.MIN_VALUE, Byte.MIN_VALUE, Byte.MIN_VALUE};
InetAddressinetAddress = getByAddress(byteArray);
StringcharSequence = inetAddress.getCanonicalHostName();
/* This execution may take longer than the 1000 ms timeout and therefore fail due to exceeding the timeout. */assertTimeoutPreemptively(Duration.ofMillis(1000L), () -> ClassUnderTest.isNull(charSequence));
}
/** * @utbot.classUnderTest {@link ClassUnderTest} * @utbot.methodUnderTest {@link ClassUnderTest#isNull(CharSequence)} */@Test@DisplayName("isNull: arg_0 = InetAddress.getCanonicalHostName()")
@Timeout(value = 1000L, unit = TimeUnit.MILLISECONDS)
publicvoidtestIsNull8() throwsUnknownHostException {
byte[] byteArray = {Byte.MIN_VALUE, Byte.MIN_VALUE, Byte.MIN_VALUE, Byte.MIN_VALUE};
InetAddressinetAddress = getByAddress(byteArray);
StringcharSequence = inetAddress.getCanonicalHostName();
/* This execution may take longer than the 1000 ms timeout and therefore fail due to exceeding the timeout. */assertTimeoutPreemptively(Duration.ofMillis(1000L), () -> ClassUnderTest.isNull(charSequence));
}
/** * @utbot.classUnderTest {@link ClassUnderTest} * @utbot.methodUnderTest {@link ClassUnderTest#isNull(CharSequence)} */@Test@DisplayName("isNull: arg_0 = InetAddress.getCanonicalHostName()")
@Timeout(value = 1000L, unit = TimeUnit.MILLISECONDS)
publicvoidtestIsNull9() throwsUnknownHostException {
byte[] byteArray = {Byte.MIN_VALUE, Byte.MIN_VALUE, Byte.MIN_VALUE, Byte.MIN_VALUE};
InetAddressinetAddress = getByAddress(byteArray);
StringcharSequence = inetAddress.getCanonicalHostName();
/* This execution may take longer than the 1000 ms timeout and therefore fail due to exceeding the timeout. */assertTimeoutPreemptively(Duration.ofMillis(1000L), () -> ClassUnderTest.isNull(charSequence));
}
///endregion///endregion
}
Description
Since #2583 fuzzer is able to construct quite complex arguments for method under test, that can take quite some time to actually create, while instrumnted-process marks executions as timed out even if the thing that actually timed out is the argument creation prior to method under test invocation.
To Reproduce
100%for the following methodExpected behavior
Two successful test and no time out test.
Actual behavior
Two successful test and 10 time out test.
Visual proofs