Skip to content

Commit 0430b04

Browse files
committed
update for parallel_full_reports.py
1 parent ee60961 commit 0430b04

File tree

4 files changed

+46
-12
lines changed

4 files changed

+46
-12
lines changed

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,29 @@ By selecting individual cases, you can view the execution reports, providing ins
348348

349349
## Known Issues
350350

351+
### ⚠️ Jenkins 2.535 “Form is larger than max length 200000”
352+
353+
**Cause:**
354+
Jenkins 2.535 upgraded to Jetty 12, which limits web form submissions to **200 KB** by default. Large Pipeline job configs can exceed this after HTML encoding.
355+
356+
**Fix:**
357+
- Move pipeline script to SCM - Instead of keeping the Groovy text inline in the job config, use Pipeline script from SCM.
358+
- Increase Jetty’s form size limit in your startup command:
359+
360+
```bash
361+
-Dorg.eclipse.jetty.server.Request.maxFormContentSize=5242880 \
362+
-Dorg.eclipse.jetty.server.Request.maxFormKeys=10000
363+
```
364+
365+
**Example**
366+
```
367+
java -Dorg.eclipse.jetty.server.Request.maxFormContentSize=5242880 \
368+
-jar jenkins.war --httpPort=9090
369+
```
370+
371+
**Notes**
372+
Old Jenkins flags `hudson.util.MultipartFormDataParser.MAX_FORM_SIZE` no longer work in 2.535+.
373+
351374
### Imported Results with Cobertura and LCOV output
352375
New output formats were added, extended cobertura format output for use with Jenkins Coverage Plugin and LCOV output support. These reporting scripts do not currently support generating coverage metrics based off of imported results.
353376

src/main/resources/scripts/generate_qa_results_xml.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,15 +185,23 @@ def processSystemTestResultsData(lines, encoding = 'utf-8'):
185185

186186
def genQATestResults(mp, level = None, envName = None, verbose = False, encoding = 'utf-8'):
187187

188+
if level and envName:
189+
nameLevel = level + "_" + envName
190+
report_name = "{}_{}_system_tests_status.html".format(os.path.basename(self.FullManageProjectName)[:-4], nameLevel)
191+
else:
192+
report_name = os.path.basename(self.FullManageProjectName)[:-4] + "_system_tests_status.html"
193+
188194
if os.path.exists(report_name):
189195
with open(report_name,"rb") as fd:
190196
raw = fd.read()
191197
out = raw.decode(encoding, 'replace')
192-
193-
passed_count, failed_count = processSystemTestResultsData(out.splitlines(), encoding)
194-
195-
saveQATestStatus(mp)
196-
198+
199+
passed_count, failed_count = processSystemTestResultsData(out.splitlines(), encoding)
200+
else:
201+
print(" ***Cannot file system test status report {}".format(report_name))
202+
passed_count = 0
203+
failed_count = 0
204+
197205
return passed_count, failed_count
198206

199207
if __name__ == '__main__':

src/main/resources/scripts/generate_xml.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1059,7 +1059,7 @@ def __init__(self, FullManageProjectName, build_dir, env, compiler, testsuite, c
10591059
if os.path.exists(cov_path):
10601060
if not system_tests_status_report_generated:
10611061
if compiler and testsuite and env:
1062-
level = compiler + "/" + testsuite + "/" + env
1062+
level = compiler + "_" + testsuite + "_" + env
10631063
report_name = "{}_{}_system_tests_status.html".format(os.path.basename(self.FullManageProjectName)[:-4], level)
10641064
else:
10651065
level = ""

src/main/resources/scripts/parallel_full_reports.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
from vector.apps.DataAPI.vcproject_api import VCProjectApi
4444

4545
from vector.apps.DataAPI.cover_api import CoverApi
46-
import multiprocessing
4746

4847
def dump(obj):
4948
if hasattr(obj, '__dict__'):
@@ -159,7 +158,8 @@ def __init__(self):
159158
try:
160159
max_cpus = os.cpu_count() # Python 3.4+
161160
except AttributeError:
162-
max_cpus = multiprocessing.cpu_count() # Python 2.7 fallback
161+
from multiprocessing import cpu_count as mp_cpu_count
162+
max_cpus = mp_cpu_count() # Python 2.7 fallback
163163
max_licenses = self.getLicenseCount()
164164

165165
print("Max CPUs : {}".format(max_cpus))
@@ -279,16 +279,19 @@ def getLicenseCount(self, network=""):
279279
return 1
280280

281281
def run(self):
282-
283-
pool = multiprocessing.Pool(processes=self.max_concurrent)
284282
try:
283+
from multiprocessing import Pool as mp_pool
284+
pool = mp_pool(processes=self.max_concurrent)
285285
results = pool.map(generate_report, self.variables)
286+
except UnboundLocalError as e:
287+
print("For some reason multiprocessing is regarded as a local variable")
288+
286289
finally:
287290
pool.close()
288291
pool.join()
289292
# Optional: force cleanup before interpreter teardown
290-
import multiprocessing.util
291-
multiprocessing.util._exit_function()
293+
from multiprocessing import util as mp_util
294+
mp_util._exit_function()
292295

293296
for key, result in results:
294297
try:

0 commit comments

Comments
 (0)