Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding test of serial form of program.dat including pickles #489

Merged
merged 3 commits into from
Dec 2, 2021

Conversation

jglick
Copy link
Member

@jglick jglick commented Nov 30, 2021

Downstream of jenkinsci/jenkins-test-harness#352.

Motivation: jenkinsci/workflow-support-plugin#126 (comment)

strings on saved program.dat
>$com.cloudbees.groovy.cps.Continuable
>$e50111df-e32b-448b-8643-93af7bd5e8cb>
>0org.jenkinsci.plugins.workflow.cps.BodyReference
>0org.jenkinsci.plugins.workflow.steps.StepContext
>1org.jenkinsci.plugins.workflow.cps.CpsStepContext
>1org.jenkinsci.plugins.workflow.cps.CpsThreadGroup
>2com.cloudbees.groovy.cps.impl.CallSiteBlockSupport
>2org.jenkinsci.plugins.workflow.steps.BodyExecution
>2org.jenkinsci.plugins.workflow.steps.StepExecution
3844427d219c>
3>9org.jenkinsci.plugins.workflow.support.steps.ExecutorStep
>3org.jenkinsci.plugins.workflow.cps.CpsBodyExecution
5'9w
5iiii9
>5org.jenkinsci.plugins.workflow.cps.ContextVariableSet
>5org.jenkinsci.plugins.workflow.cps.SandboxContinuable
5>;org.jenkinsci.plugins.workflow.steps.durable_task.ShellStep
>5touch running; while  -f running ; do sleep 1; done
>6com.google.common.collect.ImmutableList$SerializedForm
>6org.jenkinsci.plugins.workflow.cps.HandleBodyReference
8>+com.cloudbees.groovy.cps.SerializableScript
8>*java.util.concurrent.ConcurrentSkipListMap
8>+org.jenkinsci.plugins.workflow.cps.FlowHead
>9org.jenkinsci.plugins.workflow.support.DefaultStepContextG
accessOrder 
AGENT_WORKDIR>
argExps
auth
body
>bodyHeads
bodyToUnexport
>Borg.jenkinsci.plugins.workflow.cps.CpsBodyExecution$FailureAdapter
>Borg.jenkinsci.plugins.workflow.cps.CpsBodyExecution$SuccessAdapter
>Borg.jenkinsci.plugins.workflow.support.steps.ExecutorStepExecution
>callbacks
caller
callSiteLoc
capture
captured
cause
charset
closure
closures
com.cloudbees.groovy.cps.Block
>*com.cloudbees.groovy.cps.Continuation$Halt
>.com.cloudbees.groovy.cps.impl.BlockScopedBlock
>+com.cloudbees.groovy.cps.impl.BlockScopeEnv
>%com.cloudbees.groovy.cps.impl.CallEnv
>,com.cloudbees.groovy.cps.impl.ClosureCallEnv
>+com.cloudbees.groovy.cps.impl.ConstantBlock
>)com.cloudbees.groovy.cps.impl.CpsCallable
>(com.cloudbees.groovy.cps.impl.CpsClosure
>+com.cloudbees.groovy.cps.impl.CpsClosureDef
>/com.cloudbees.groovy.cps.impl.FunctionCallBlock
>-com.cloudbees.groovy.cps.impl.FunctionCallEnv
>+com.cloudbees.groovy.cps.impl.JavaThisBlock
>&com.cloudbees.groovy.cps.impl.ProxyEnv
>+com.cloudbees.groovy.cps.impl.SequenceBlock
>,com.cloudbees.groovy.cps.impl.SourceLocation
>)com.cloudbees.groovy.cps.impl.TryBlockEnv
>'com.cloudbees.groovy.cps.MethodLocation
,com.cloudbees.groovy.cps.sandbox.CallSiteTag
>/com.cloudbees.groovy.cps.sandbox.SandboxInvoker
>*com.cloudbees.groovy.cps.sandbox.Untrusted
comparator
completionHandlers
context
contextVariables
controlDir
controller
cookie
>Corg.jenkinsci.plugins.durabletask.BourneShellScript$ShellController
>Corg.jenkinsci.plugins.workflow.steps.BodyExecutionCallback$TailCall
declaringClass
delegate
depth#
detailMessage
>directive#
elements
>Eorg.jenkinsci.plugins.workflow.support.pickles.serialization.DryOwner
executionRef
EXECUTOR_NUMBER>
exp1
exp2
fileName
finally_
>Gorg.jenkinsci.plugins.workflow.support.pickles.serialization.DryCapsule
>Gorg.jenkinsci.plugins.workflow.support.pickles.WorkspaceListLeasePickle0|
groovy.lang.Closure<
group
handle
handlers
head
HOME>
/home/jenkins>
/home/jenkins/agent>
/home/jenkins/agent/workspace/p
/home/jenkins/agent/workspace/p5
/home/jenkins/agent/workspace/p9
/home/jenkins>WORKSPACE>
HOSTNAME>
http://localhost:64811/jenkins/>JAVA_HOME>
hudson.EnvVars;
hudson.Platform
HUDSON_URL>
>%hudson.util.CaseInsensitiveComparator
i9Z9iiiii
>interrupt
invoker
iota#
isEphemeral 
isZos 
>-%j
java.lang.Throwable
java.util.Arrays$ArrayList
>)java.util.concurrent.atomic.AtomicBoolean@
java.util.HashMap
java.util.LinkedHashMap4
java.util.TreeMap
JENKINS_AGENT_NAME>
JENKINS_NODE_COOKIE>$e50111df-e32b-448b-8643-93af7bd5e8cb>
JENKINS_SECRET>@defebc83e8736659464a172801f43de376f751891e69cb6ece89e856d6cc3b48>
JENKINS_URL9
JENKINS_WEB_SOCKET>
>Korg.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution
label
lastLocation$
lease
lhsExp
lineNumber#
loadFactor&
locals
maximumNumberOfParameters#
method
methodName
>Morg.jenkinsci.plugins.durabletask.FileMonitoringTask$FileMonitoringController
nameExp
node
NODE_LABELS>
>onFailure
>onSuccess
/opt/java/openjdk>
>,org.jenkinsci.plugins.durabletask.Controller
>.org.jenkinsci.plugins.workflow.cps.CpsClosure2
>,org.jenkinsci.plugins.workflow.cps.CpsScript
>,org.jenkinsci.plugins.workflow.cps.CpsThread
>&org.jenkinsci.plugins.workflow.cps.DSL
,org.jenkinsci.plugins.workflow.cps.Safepoint
>-org.jenkinsci.plugins.workflow.pickles.Pickle
>>org.jenkinsci.plugins.workflow.steps.AbstractStepExecutionImpl
>:org.jenkinsci.plugins.workflow.steps.BodyExecutionCallback
>=org.jenkinsci.plugins.workflow.support.pickles.ComputerPickle
>=org.jenkinsci.plugins.workflow.support.pickles.ExecutorPickle
>org.jenkinsci.plugins.workflow.support.steps.ExecutorStepExecution$PlaceholderTask$Callback
outcome
owner
parameters
parameterTypes
parent
path
PATH>R/opt/java/openjdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin>
paused
platform
program
PWD>
remote>
remoteK
remote>NODE_NAME>
resolveStrategy#
resumeValue
returnAddress
returnStatus 
returnStdout 
>Rorg.jenkinsci.plugins.workflow.support.steps.ExecutorStepExecution$PlaceholderTask
runId
RZ9{>
safe 
>safepoint
scripts
self
slave
stackTrace
startNodeId
step
stepDescriptorId
steps
stopped
suppressedExceptions
suspendValue
SYSTEM_DEFAULT>4/home/jenkins/agent/workspace/p@tmp/durable-dae459c1
tags
task
this
this$0
thisObject
thread
threadId#
threads
>threshold#
true>
types
UNIX
value
values
watching 
WorkflowScript
>Zorg.jenkinsci.plugins.workflow.support.steps.FilePathDynamicContext$FilePathRepresentation

@jglick jglick requested a review from dwnusbaum November 30, 2021 22:05
@jglick jglick added the tests label Dec 1, 2021
Copy link
Member

@dwnusbaum dwnusbaum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be interesting to add another test where program.dat exists but is corrupted, but the new test looks fine to me.

@@ -0,0 +1,50 @@
<?xml version='1.1' encoding='UTF-8'?>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Personally I prefer to use ZIP files with @LocalData so this kind of stuff does not come up in GitHub searches, but maybe you prefer doing things this way for other reasons.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

come up in GitHub searches

Could be an issue I suppose. I normally prefer exploded $JENKINS_HOME because it is easier to review, and occasionally it even makes sense to change one line of one file, which in a ZIP would just be an opaque blob.

@jglick
Copy link
Member Author

jglick commented Dec 1, 2021

another test where program.dat exists but is corrupted

Could be interesting for certain purposes. The motivation here was unrelated—to verify that the existing format of current Pipeline builds using common steps can still be loaded even if we move the JBoss Marshalling code here from workflow-support, or change the file format to avoid the awkward pickle offset.

@jglick jglick marked this pull request as ready for review December 1, 2021 20:54
@jglick jglick requested a review from car-roll December 1, 2021 20:54
@car-roll car-roll merged commit fc3007f into jenkinsci:master Dec 2, 2021
@jglick jglick deleted the SerialFormTest branch December 2, 2021 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants