Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-10592

Issues with P4 counters not working correctly in matrix builds

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • p4-plugin
    • None
    • Jenkins 1.424
      Perforce plugin 1.3.0

      Hi,

      I'm having problems getting the Perforce plugin counter system to work properly. This is my setup:

      JobA (matrix project): 
      	P4 Counter = TOMLABEL
      	Update counter to most recent changeset = ticked
      	Build other projects = JobB
      
      	JobB (free-style project):
      	P4 Counter = TOMLABEL
      	Update counter to most recent changeset = not ticked
      

      So when I make a change in Perforce JobA is triggered. If I check the Console Output for the parent job it contains:

      Updating counter TOMLABEL to 140403
      [workspace] $ "C:\\Program Files\\Perforce\\p4.exe" counter TOMLABEL 140403
      

      Each element of JobA's matrix then builds. In the Console output for those builds I see a lot of this:

      [Win32] $ "C:\\Program Files\\Perforce\\p4.exe" -s sync -f //personal/tfields/Live/Engine/Tools/program.exe@140403
      

      which is what I expect to see, ie. it's syncing to my counter.

      In between JobA finishing and JobB starting I check in another file which means the latest changelist Perforce knows about is now 140404.

      So JobA finally finishes building, succeeds and triggers JobB.

      All JobB does is print out the current value of TOMLABEL. So if I check the Console Output I would expect to see the value 140403. Unfortunately I don't. I get the value 140404 back.

      [workspace] $ "C:\\Program Files\\Perforce\\p4.exe" workspace -o Jenkins_External
      18:24:53  Last build changeset: 140392
      18:24:53  [workspace] $ "C:\\Program Files\\Perforce\\p4.exe" counter TOMLABEL
      18:24:53  [workspace] $ "C:\\Program Files\\Perforce\\p4.exe" -s changes //Jenkins_External/...@140393,@140404
      18:24:53  [workspace] $ "C:\\Program Files\\Perforce\\p4.exe" describe -s 140404
      18:24:53  [workspace] $ "C:\\Program Files\\Perforce\\p4.exe" -G where //personal/tfields/Live/Engine/External/NvTriStrip/NvTriStrip.cpp
      18:24:53  [workspace] $ "C:\\Program Files\\Perforce\\p4.exe" describe -s 140403
      18:24:53  [workspace] $ "C:\\Program Files\\Perforce\\p4.exe" -G where //personal/tfields/Live/Engine/Core/Engine.cpp
      18:24:54  Buildfile: C:\JCI\jobs\External\workspace\build-jci.xml
      18:24:54  
      18:24:54  PrintInfo:
      18:24:54       [exec] TOMLABEL = 140404
      

      Any ideas why this is happening. It seems like a bug to me.

      Regards,
      Tom.

      – Posted from Bugbox for Android

          [JENKINS-10592] Issues with P4 counters not working correctly in matrix builds

          Thomas Fields created issue -
          Rob Petti made changes -
          Assignee New: Rob Petti [ rpetti ]
          Description Original: Hi,

          I'm having problems getting the Perforce plugin counter system to work properly. This is my setup:

          {code}
          JobA (matrix project):
          P4 Counter = TOMLABEL
          Update counter to most recent changeset = ticked
          Build other projects = JobB
          {code}

          {code}
          JobB (free-style project):
          P4 Counter = TOMLABEL
          Update counter to most recent changeset = not ticked
          {code}

          So when I make a change in Perforce JobA is triggered. If I check the Console Output for the parent job it contains:

          {code}
          Updating counter TOMLABEL to 140403
          [workspace] $ "C:\\Program Files\\Perforce\\p4.exe" counter TOMLABEL 140403
          {code}

          Each element of JobA's matrix then builds. In the Console output for those builds I see a lot of this:

          {code}
          [Win32] $ "C:\\Program Files\\Perforce\\p4.exe" -s sync -f //personal/tfields/Live/Engine/Tools/program.exe@140403
          {code}

          which is what I expect to see, ie. it's syncing to my counter.

          In between JobA finishing and JobB starting I check in another file which means the latest changelist Perforce knows about is now 140404.

          So JobA finally finishes building, succeeds and triggers JobB.

          All JobB does is print out the current value of TOMLABEL. So if I check the Console Output I would expect to see the value 140403. Unfortunately I don't. I get the value 140404 back.

          {code}
          [workspace] $ "C:\\Program Files\\Perforce\\p4.exe" workspace -o Jenkins_External
          18:24:53 Last build changeset: 140392
          18:24:53 [workspace] $ "C:\\Program Files\\Perforce\\p4.exe" counter TOMLABEL
          18:24:53 [workspace] $ "C:\\Program Files\\Perforce\\p4.exe" -s changes //Jenkins_External/...@140393,@140404
          18:24:53 [workspace] $ "C:\\Program Files\\Perforce\\p4.exe" describe -s 140404
          18:24:53 [workspace] $ "C:\\Program Files\\Perforce\\p4.exe" -G where //personal/tfields/Live/Engine/External/NvTriStrip/NvTriStrip.cpp
          18:24:53 [workspace] $ "C:\\Program Files\\Perforce\\p4.exe" describe -s 140403
          18:24:53 [workspace] $ "C:\\Program Files\\Perforce\\p4.exe" -G where //personal/tfields/Live/Engine/Core/Engine.cpp
          18:24:54 Buildfile: C:\JCI\jobs\External\workspace\build-jci.xml
          18:24:54
          18:24:54 PrintInfo:
          18:24:54 [exec] TOMLABEL = 140404
          {code}

          Any ideas why this is happening. It seems like a bug to me.

          Regards,
          Tom.
          New: Hi,

          I'm having problems getting the Perforce plugin counter system to work properly. This is my setup:

          {code}
          JobA (matrix project):
          P4 Counter = TOMLABEL
          Update counter to most recent changeset = ticked
          Build other projects = JobB
          {code}

          {code}
          JobB (free-style project):
          P4 Counter = TOMLABEL
          Update counter to most recent changeset = not ticked
          {code}

          So when I make a change in Perforce JobA is triggered. If I check the Console Output for the parent job it contains:

          {code}
          Updating counter TOMLABEL to 140403
          [workspace] $ "C:\\Program Files\\Perforce\\p4.exe" counter TOMLABEL 140403
          {code}

          Each element of JobA's matrix then builds. In the Console output for those builds I see a lot of this:

          {code}
          [Win32] $ "C:\\Program Files\\Perforce\\p4.exe" -s sync -f //personal/tfields/Live/Engine/Tools/program.exe@140403
          {code}

          which is what I expect to see, ie. it's syncing to my counter.

          In between JobA finishing and JobB starting I check in another file which means the latest changelist Perforce knows about is now 140404.

          So JobA finally finishes building, succeeds and triggers JobB.

          All JobB does is print out the current value of TOMLABEL. So if I check the Console Output I would expect to see the value 140403. Unfortunately I don't. I get the value 140404 back.

          {code}
          [workspace] $ "C:\\Program Files\\Perforce\\p4.exe" workspace -o Jenkins_External
          18:24:53 Last build changeset: 140392
          18:24:53 [workspace] $ "C:\\Program Files\\Perforce\\p4.exe" counter TOMLABEL
          18:24:53 [workspace] $ "C:\\Program Files\\Perforce\\p4.exe" -s changes //Jenkins_External/...@140393,@140404
          18:24:53 [workspace] $ "C:\\Program Files\\Perforce\\p4.exe" describe -s 140404
          18:24:53 [workspace] $ "C:\\Program Files\\Perforce\\p4.exe" -G where //personal/tfields/Live/Engine/External/NvTriStrip/NvTriStrip.cpp
          18:24:53 [workspace] $ "C:\\Program Files\\Perforce\\p4.exe" describe -s 140403
          18:24:53 [workspace] $ "C:\\Program Files\\Perforce\\p4.exe" -G where //personal/tfields/Live/Engine/Core/Engine.cpp
          18:24:54 Buildfile: C:\JCI\jobs\External\workspace\build-jci.xml
          18:24:54
          18:24:54 PrintInfo:
          18:24:54 [exec] TOMLABEL = 140404
          {code}

          Any ideas why this is happening. It seems like a bug to me.

          Regards,
          Tom.

          -- Posted from Bugbox for Android
          Rob Petti made changes -
          Link New: This issue depends on JENKINS-10606 [ JENKINS-10606 ]
          Rob Petti made changes -
          Summary Original: Issues with P4 counters not working correctly New: Issues with P4 counters not working correctly in matrix builds
          Thomas Fields made changes -
          Attachment New: PerforceSCM.java [ 20687 ]
          Thomas Fields made changes -
          Attachment New: PerforceSCM.java [ 20688 ]
          Rob Petti made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 140786 ] New: JNJira + In-Review [ 189259 ]
          Jenkins IRC Bot made changes -
          Component/s New: p4-plugin [ 19224 ]
          Component/s Original: perforce-plugin [ 15506 ]

            rpetti Rob Petti
            tfields Thomas Fields
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: