ksoichiro / gradle-web-resource-plugin

Gradle plugin to use CoffeeScript, LESS and Bower libraries without Node.js/npm.
Apache License 2.0
23 stars 5 forks source link

Failing update test #9

Closed sratatata closed 8 years ago

sratatata commented 8 years ago

During test run update test is failing:

:plugin:test

com.github.ksoichiro.web.resource.WebResourceInstallBowerDependenciesTaskSpec > update FAILED
    org.spockframework.runtime.UnallowedExceptionThrownError at WebResourceInstallBowerDependenciesTaskSpec.groovy:98
        Caused by: org.gradle.api.tasks.TaskExecutionException at WebResourceInstallBowerDependenciesTaskSpec.groovy:95
            Caused by: org.gradle.internal.UncheckedException at WebResourceInstallBowerDependenciesTaskSpec.groovy:95
                Caused by: java.util.concurrent.ExecutionException at WebResourceInstallBowerDependenciesTaskSpec.groovy:95
                    Caused by: org.mozilla.javascript.JavaScriptException

34 tests completed, 1 failed
:plugin:test FAILED
testsuite com.github.ksoichiro.web.resource.WebResourceInstallBowerDependenciesTaskSpec:
  testcase com.github.ksoichiro.web.resource.WebResourceInstallBowerDependenciesTaskSpec > update: Expected no exception of type 'java.lang.Exception' to be thrown, but got it nevertheless
    at spock.lang.Specification.notThrown(Specification.java:106)
    at com.github.ksoichiro.web.resource.WebResourceInstallBowerDependenciesTaskSpec.update(WebResourceInstallBowerDependenciesTaskSpec.groovy:98)
Caused by: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':webResourceInstallBowerDependencies'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
    at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
    at org.gradle.api.internal.AbstractTask.execute(AbstractTask.java:305)
    at com.github.ksoichiro.web.resource.WebResourceInstallBowerDependenciesTaskSpec.update(WebResourceInstallBowerDependenciesTaskSpec.groovy:95)
Caused by: org.gradle.internal.UncheckedException: java.util.concurrent.ExecutionException: org.mozilla.javascript.JavaScriptException: InternalError: Script exit: Normal (/tmp/junit8403202543422224042/build/webResource/node_modules/q/q.js#161)
    at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:45)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:78)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:227)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:220)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:209)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:585)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:568)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
    ... 10 more
Caused by: java.util.concurrent.ExecutionException: org.mozilla.javascript.JavaScriptException: InternalError: Script exit: Normal (/tmp/junit8403202543422224042/build/webResource/node_modules/q/q.js#161)
    at io.apigee.trireme.core.ScriptFuture.getResult(ScriptFuture.java:82)
    at io.apigee.trireme.core.ScriptFuture.get(ScriptFuture.java:97)
    at io.apigee.trireme.core.ScriptFuture.get(ScriptFuture.java:36)
    at com.github.ksoichiro.web.resource.node.TriremeNodeRunner.exec(TriremeNodeRunner.groovy:25)
    at com.github.ksoichiro.web.resource.task.WebResourceInstallBowerDependenciesTask.exec(WebResourceInstallBowerDependenciesTask.groovy:76)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
    ... 17 more
Caused by: org.mozilla.javascript.JavaScriptException: InternalError: Script exit: Normal (/tmp/junit8403202543422224042/build/webResource/node_modules/q/q.js#161)
    at org.mozilla.javascript.gen._tmp_junit8403202543422224042_build_webResource_node_modules_q_q_js_4191._c_anonymous_9(/tmp/junit8403202543422224042/build/webResource/node_modules/q/q.js:161)
    at org.mozilla.javascript.optimizer.OptRuntime.callProp0(OptRuntime.java:85)
    at io.apigee.trireme.node12.node.timers._c_listOnTimeout_3(timers.js:119)
    at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:393)
    at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3282)
    at io.apigee.trireme.node12.modules.TimerWrap$TimerImpl.execute(TimerWrap.java:280)
    at io.apigee.trireme.core.internal.ScriptRunner$Task.executeTask(ScriptRunner.java:1485)
    at io.apigee.trireme.core.internal.ScriptRunner$AbstractTask.execute(ScriptRunner.java:1456)
    at io.apigee.trireme.core.internal.ScriptRunner.executeTimerTasks(ScriptRunner.java:1124)
    at io.apigee.trireme.core.internal.ScriptRunner.mainLoop(ScriptRunner.java:946)
    at io.apigee.trireme.core.internal.ScriptRunner.runScript(ScriptRunner.java:774)
    at io.apigee.trireme.core.internal.ScriptRunner$4.run(ScriptRunner.java:702)
    at org.mozilla.javascript.Context.call(Context.java:501)
    at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:503)
    at io.apigee.trireme.core.internal.ScriptRunner.call(ScriptRunner.java:697)
    at io.apigee.trireme.core.ScriptFuture.run(ScriptFuture.java:183)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

:plugin:generateCoberturaReport SKIPPED
:plugin:performCoverageCheck SKIPPED

FAILURE: Build failed with an exception.

I'm playing on quite fresh installed linux now. Then maybe It's missing something. However it's out of my expertise to debug this problem quickly. Something with concurency?

sratatata commented 8 years ago

I found that tests should be running with parallel factor = 1 in other case the race could cause faulty reading status from exceptions.

In this case I can see real cause of failure.

om.github.ksoichiro.web.resource.WebResourceInstallBowerDependenciesTaskSpec > update STANDARD_OUT
    { [Error: No cached version for git://github.com/jquery/jquery-dist.git#2.1.4]
      message: 'No cached version for git://github.com/jquery/jquery-dist.git#2.1.4',
      code: 'ENOCACHE',
      resolver: 
       { _source: 'git://github.com/jquery/jquery-dist.git',
         _target: '2.1.4',
         _name: 'jquery',
         _config: 
          { directory: 'bower_components',
            registry: [Object],
            shorthandResolver: 'git://github.com/{{owner}}/{{package}}.git',
            tmp: '/tmp/lb_lb/bower',
            timeout: 30000,
            ca: [Object],
            strictSsl: true,
            userAgent: 'node/v0.12.7 linux amd64',
            color: true,
            storage: [Object],
            cwd: '/tmp/junit2340503554196960162/build/webResource',
            offline: true,
            interactive: false },
         _logger: { _interceptors: [Object], _piped: [Object] },
         _guessedName: false,
         _host: 'github.com',
         _remote: 
          { protocol: 'git:',
            slashes: true,
            auth: null,
            host: 'github.com',
            port: null,
            hostname: 'github.com',
            hash: null,
            search: null,
            query: null,
            pathname: '/jquery/jquery-dist.git',
            path: '/jquery/jquery-dist.git',
            href: 'git://github.com/jquery/jquery-dist.git' },
         _shallowClone: [Function],
         _org: 'jquery',
         _repo: 'jquery-dist',
         _public: true },
      fileName: '/tmp/junit2340503554196960162/build/webResource/node_modules/bower/lib/core/PackageRepository.js',
      lineNumber: 67,
      data: 
       { endpoint: { name: '', source: 'jquery', target: '2.1.4' },
         resolver: 
          { name: 'jquery',
            source: 'git://github.com/jquery/jquery-dist.git',
            target: '2.1.4' } },
      stack: 'Error: No cached version for git://github.com/jquery/jquery-dist.git#2.1.4\n    at /tmp/junit2340503554196960162/build/webResource/node_modules/q/q.js:1763\n    at _fulfilled (/tmp/junit2340503554196960162/build/webResource/node_modules/q/q.js:834)\n    at /tmp/junit2340503554196960162/build/webResource/node_modules/q/q.js:863\n    at /tmp/junit2340503554196960162/build/webResource/node_modules/q/q.js:796\n    at /tmp/junit2340503554196960162/build/webResource/node_modules/q/q.js:556\n    at runSingle (/tmp/junit2340503554196960162/build/webResource/node_modules/q/q.js:137)\n    at flush (/tmp/junit2340503554196960162/build/webResource/node_modules/q/q.js:125)\n    at processImmediate (timers.js:370)\n' }
sratatata commented 8 years ago

bower cache clean solves problem. :dancer: