-
Notifications
You must be signed in to change notification settings - Fork 61
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
Fix Serialization Issue with 'isDefault' Field in DataFileRequest #262
Conversation
@@ -381,10 +381,11 @@ private void saveDataFile(DataFileRequest dataFileRequest) { | |||
"writing file " + dataFileRequest.getFileName() + " to " + dataFile.getAbsolutePath() | |||
+ " from url " + url.toExternalForm()))); | |||
FileUtils.copyURLToFile(url, dataFile); | |||
if (dataFileRequest.isDefault() | |||
if (dataFileRequest.isDefaultDataFile() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Zakaria-Kofiro To unblock this change will resolve, but can we circle around with a follow-up ticket to rename the isDefaultDataFile property to something else?
Because this conditional upon reading is confusing because the conditional is saying:
- IF it is a default data file flag TRUE, but the data file name is NOT equal the default file name
csv-data.txt
, then enter
It makes it seem like the two conditionals are contradicting, seems the isDefaultDataFile is actually is the number of data files equal to 1 based on https://github.com/intuit/Tank/blob/cefa8e5a720820970e1f49af1c3332d09d661cca/tank_vmManager/src/main/java/com/intuit/tank/perfManager/workLoads/JobManager.java#L302C27-L302C27
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, it confused me as well. The workflow is that it checks if there's a single datafile (in JobManager), and if there is, sets the conditional isDefaultDataFile
to true
from the controller. It is then sent to each agent which checks (in APITestHarness) whether both the default data flag is true
and makes sure that it doesn't share a name with the default file name csv-data.txt
. That's because it then copies the content from the original file to csv-data.txt
which is then referenced throughout the rest of the code as the default datafile. I do agree that we should rename this, and maybe even revisit the workflow itself to just use the original file.
Fix Serialization Issue with 'isDefault' Field in DataFileRequest
When Tank jobs are run with only one DataFile, that DataFile in turn becomes the default DataFile for the job. This allows functions like
#{ioFunctions.getCSVData(0)}
to be used in scripts without the need to explicitly define which DataFile to pull from. This worked as intended until recently when it stopped setting single DataFiles as default, with the root cause of this issue being related to the serialization of theisDefault
field. It was being serialized incorrectly todefault
and always had it's value set to it's default value offalse
when it was initially sent to the agent astrue
:This was fixed by updating the field to
isDefaultDataFile
and setting the@JsonProperty
and@XmlElement
annotations accordingly:Please make sure these check boxes are checked before submitting
mvn clean test -P default
** PR review process **