[GRADLE-2005] Received a failure event for test with unknown id Created: 17/Dec/11  Updated: 11/Nov/13  Resolved: 11/Nov/13

Status: Resolved
Project: Gradle
Affects Version/s: None
Fix Version/s: 1.4-rc-1

Type: Bug
Reporter: Gradle Forums Assignee: Unassigned
Resolution: Fixed Votes: 1


 Description   

I'm running M6. I'm trying to run my tests, and I'm getting failures like:

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':Base:test'.
    Cause: Received a failure event for test with unknown id '67.9'. Registered test ids: '[2.2, 2.1, 2.7, 10.2, 10.1, 10.5, 19.2, 19.3, 19.1, 58.8, 52.2, 52.1, 56.3, 58.1, 57.2, 59.1, 56.2, 59.2, 56.1, 58.2, 57.1, 62.1, 59.5, 60.2, 62.3, 60.1, 57.4, 62.2, 67.7, 69.1, 67.6, 71.2, 71.1, 69.2, 67.3, 67.2, 67.1, 69.6, 79.3, 67.14, 76.1, 79.2, 72.6, 76.2, 79.1, 75.3, 73.1, 74.2, 67.10, 72.1, 75.2, 75.1, 72.2, 74.1, 73.2, 87.2, 84.1, 85.1, 86.2, 85.2, 86.1, 84.2, 87.1, 83.2, 80.1, 83.3, 67.19, 81.1, 82.2, 80.3, 82.1, 81.2, 81.3, 80.2, 83.1, 67.28, 88.1, 89.1, 88.3, 89.2, 88.2, root]'
  • Try:
    Run with --info or --debug option to get more log output.
  • Exception is:
    org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':Base:test'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:71)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:48)
    at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:34)
    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:55)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:57)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:41)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:42)
    at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:243)
    at org.gradle.execution.DefaultTaskGraphExecuter.executeTask(DefaultTaskGraphExecuter.java:192)
    at org.gradle.execution.DefaultTaskGraphExecuter.doExecute(DefaultTaskGraphExecuter.java:177)
    at org.gradle.execution.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:83)
    at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:36)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:70)
    at org.gradle.execution.DefaultBuildExecuter.access$300(DefaultBuildExecuter.java:23)
    at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:80)
    at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:70)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:63)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:157)
    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:112)
    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:80)
    at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:45)
    at org.gradle.launcher.exec.DefaultGradleLauncherActionExecuter.execute(DefaultGradleLauncherActionExecuter.java:49)
    at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:41)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:116)
    at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:45)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:116)
    at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:48)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:116)
    at org.gradle.launcher.daemon.server.exec.HandleSleep.execute(HandleSleep.java:35)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:116)
    at org.gradle.launcher.daemon.server.exec.ReportExceptions.execute(ReportExceptions.java:36)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:116)
    at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:24)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:116)
    at org.gradle.launcher.daemon.server.exec.ForwardOutput.execute(ForwardOutput.java:46)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:116)
    at org.gradle.launcher.daemon.server.exec.ReturnResult.execute(ReturnResult.java:32)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:116)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:84)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:82)
    at org.gradle.util.Swapper.swap(Swapper.java:38)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:82)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:116)
    at org.gradle.launcher.daemon.server.exec.UpdateDaemonStateAndHandleBusyDaemon.execute(UpdateDaemonStateAndHandleBusyDaemon.java:33)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:116)
    at org.gradle.launcher.daemon.server.exec.HandleStop.execute(HandleStop.java:34)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:116)
    at org.gradle.launcher.daemon.server.exec.CatchAndForwardDaemonFailure.execute(CatchAndForwardDaemonFailure.java:34)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:116)
    at org.gradle.launcher.daemon.server.exec.HandleClientDisconnectBeforeSendingCommand.execute(HandleClientDisconnectBeforeSendingCommand.java:21)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:116)
    at org.gradle.launcher.daemon.server.exec.StopConnectionAfterExecution.execute(StopConnectionAfterExecution.java:21)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:116)
    at org.gradle.launcher.daemon.server.exec.DefaultDaemonCommandExecuter.executeCommand(DefaultDaemonCommandExecuter.java:47)
    at org.gradle.launcher.daemon.server.Daemon$1$1.run(Daemon.java:103)
    at org.gradle.messaging.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:64)
    Caused by: java.lang.IllegalArgumentException: Received a failure event for test with unknown id '67.9'. Registered test ids: '[2.2, 2.1, 2.7, 10.2, 10.1, 10.5, 19.2, 19.3, 19.1, 58.8, 52.2, 52.1, 56.3, 58.1, 57.2, 59.1, 56.2, 59.2, 56.1, 58.2, 57.1, 62.1, 59.5, 60.2, 62.3, 60.1, 57.4, 62.2, 67.7, 69.1, 67.6, 71.2, 71.1, 69.2, 67.3, 67.2, 67.1, 69.6, 79.3, 67.14, 76.1, 79.2, 72.6, 76.2, 79.1, 75.3, 73.1, 74.2, 67.10, 72.1, 75.2, 75.1, 72.2, 74.1, 73.2, 87.2, 84.1, 85.1, 86.2, 85.2, 86.1, 84.2, 87.1, 83.2, 80.1, 83.3, 67.19, 81.1, 82.2, 80.3, 82.1, 81.2, 81.3, 80.2, 83.1, 67.28, 88.1, 89.1, 88.3, 89.2, 88.2, root]'
    at org.gradle.api.internal.tasks.testing.results.StateTrackingTestResultProcessor.failure(StateTrackingTestResultProcessor.java:58)
    at org.gradle.api.internal.tasks.testing.results.AttachParentTestResultProcessor.failure(AttachParentTestResultProcessor.java:41)
    at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
    at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
    at org.gradle.messaging.dispatch.FailureHandlingDispatch.dispatch(FailureHandlingDispatch.java:29)
    at org.gradle.messaging.dispatch.AsyncDispatch.dispatchMessages(AsyncDispatch.java:132)
    at org.gradle.messaging.dispatch.AsyncDispatch.access$000(AsyncDispatch.java:33)
    at org.gradle.messaging.dispatch.AsyncDispatch$1.run(AsyncDispatch.java:72)
    ... 1 more

BUILD FAILED



 Comments   
Comment by Gradle Forums [ 17/Dec/11 ]

Can you reproduce this problem consistently? If so, could you possibly narrow down the suite to track down which test(s) cause this problem? Or even, better, any chance we could get hold of a sample project that reproduces the problem?

Comment by Gradle Forums [ 17/Dec/11 ]

It happens every time. The test IDs change, but it always breaks.

I've managed to track down the bad test. Here's a sample that demonstrates the problem:

package foo;

import junit.framework.Test;
import junit.framework.TestCase;
import junit.extensions.ActiveTestSuite;

public class ExampleTest extends TestCase
{
public ExampleTest(String testName)
{
super(testName);
}

public void testA() {
}

public static Test suite() {
ActiveTestSuite suite = new ActiveTestSuite();
for(int i=0; i < 100; i++) {
suite.addTest(new ExampleTest("testA"));
}

return suite;
}
}

Don't ask me why the test does this - I have no idea.

You'll notice the tests are added in a for loop that goes up to 100. When the failure occurs seems random. Sometimes, it occurs as low as test ID 4 or 5. Sometimes, it goes as high as 25. If I only add one or two, the test has a chance of finishing successfully. By adding 100, I'm pretty much guaranteeing that the test will fail.

Comment by Gradle Forums [ 17/Dec/11 ]

Thank you very much for the sample!

Comment by Adam Murdoch [ 30/Apr/13 ]

This should be fixed in Gradle 1.4. Can you verify and let us know?

Generated at Wed Jun 30 12:10:12 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.