* [JENKINS-60351] It should be possible to disable a retry of the
PathRemover
This does not address the issues that the comments and code in
hudons.Util are inconsistent if they are for retries or total number of
attempts (they are currently total number of attempts)
* [JENKINS-60351] Make the code conform to the documentation
maxRetries should control the number of retries not the number of
attempts.
* rename field from DELETION_MAX to DELETION_RETRIES
This also refactors some test calls to mklink into a package-private Util method due to additional tests needing to create junction points.
Signed-off-by: Matt Sicker <boards@gmail.com>
The simplified form that this replaces has an issue where a file contained somewhere inside a symbolic link is also considered a symbolic link on Windows.
Signed-off-by: Matt Sicker <boards@gmail.com>
This removes duplicated tests from UtilTest that were added in PathRemoverTest. This also ports the sleep/gc strategy for use by default to preserve backward compatibility.
Signed-off-by: Matt Sicker <boards@gmail.com>
* Reduce memory footprint for the plugin info by presizing hashmaps to reduce waste for small maps and interning commonly duplicated plugin strings
* Replace duplicated empty string arrays with the one in MemoryReductionUtil
* Fix interning where strings are null
* Fix to deal with the fact that we directly mutate dependency fields for UpdateSite, sigh
* Reduce starting HashMap size for some hashmaps likely to be empty or tiny
* Cleanup per review comments
* Trim some extra waste out of the UpdateSite warnings
* Fix count of optional dependencies
* Move predicates for dependency matching to top-level static final field so they are not duplicated
- in case of migration we put null instead of now
- improve also the difference in days for the Xxx day(s) ago to take calendar day in difference and not the total duration (<24h = 0 days, which seems wrong in UI)
* Fix a race condition in Util.loadFile()
If the file is deleted in between when its existence is checked and the
file is opened for reading, then the method will fail to return an empty
string.
* Switch to using FileUtils.readFileToString()
(cherry picked from commit aaae71af4b)