Uploaded image for project: 'Buildr (Retired)'
  1. Buildr (Retired)
  2. BUILDR-275

race condition in ant.rb when using parallel build

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.3.4
    • 1.5
    • Test frameworks
    • None
    • linux 2.6, jruby 1.1.5, java project, junit
      Buildr.options.parallel=true

    Description

      When Buildr.options.parallel=true

      If two projects start executing a junit test task at the same time they fail with:

      Test framework error: uninitialized constant Antwrap::AntProject
      or
      Test framework error: uninitialized constant Antwrap::AntProject::Main
      or
      wrong # of arguments(0 for 1) for using


      the problem is in ant.rb
      in the method def ant(name, &block)

      synchronizing the method fixes the problem.

      my buildfile:
      VERSION_NUMBER = "1.0.0"
      GROUP = "bu"
      COPYRIGHT = ""

      repositories.remote << "http://repo1.maven.org/maven2/"
      repositories.remote << "http://www.ibiblio.org/maven2/"

      Buildr.options.parallel=true

      desc "The Bu project"
      define "bu" do

      project.version = VERSION_NUMBER
      project.group = GROUP
      manifest["Implementation-Vendor"] = COPYRIGHT

      define "sub1" do
      package(:jar)
      end

      define "sub2" do
      package(:jar)
      end
      end

      my layout:
      .
      ./sub1
      ./sub1/src
      ./sub1/src/test
      ./sub1/src/test/java
      ./sub1/src/test/java/TestClazz.java
      ./sub1/src/main
      ./sub1/src/main/java
      ./sub2
      ./sub2/src
      ./sub2/src/test
      ./sub2/src/test/java
      ./sub2/src/test/java/TestClazz.java
      ./sub2/src/main
      ./sub2/src/main/java
      ./buildfile

      and TestClazz.java is:
      import org.junit.*;

      public class TestClazz {
      @Test
      public void testMethod() throws Exception {
      }
      }

      Attachments

        1. buildr-ant-race.zip
          3 kB
          Tuomas Karkkainen

        Activity

          People

            Unassigned Unassigned
            tuomask Tuomas Karkkainen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: