Message11179

Author stefan.richthofer
Recipients jamesmudd, jeff.allen, stefan.richthofer, zyasoft
Date 2017-03-04.23:26:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1488669960.88.0.496352173084.issue2559@psf.upfronthosting.co.za>
In-reply-to
Content
As follows we can retrieve the Xss value at runtime.

Jython 2.7.1rc1 (, Mär 4 2017, 22:31:12) 
[OpenJDK 64-Bit Server VM (Oracle Corporation)] on java1.8.0_121
Type "help", "copyright", "credits" or "license" for more information.
>>> from java.lang.management import ManagementFactory
>>> rtmx = ManagementFactory.getRuntimeMXBean()
>>> rtmx
sun.management.RuntimeImpl@64f555e7
>>> ags = rtmx.getInputArguments()
>>> ags
[-Xmx512m, -Xss1024k, -Dpython.home=dist, -Dpython.executable=dist/bin/jython]
>>> ags[1]
u'-Xss1024k'
>>> 

Based on this we could implement a @skipif guarding the case that Xss is <3m.

Parsing of the -Xss value should better done on Java-side in a utility method, e.g. in Py.java or so. Also one must consider to properly map the k, m or whatever properly.

I know, this method only reveals -Xss if that arg was given on command line. However since our launchers always provide it, this would work reliably on Jython. Should still have a fallback (to None?) if the value wasn't provided, e.g. because launched directly via java-command.

How should None then be treated by the @skipif? Actually I don't care. Either way is fine; someone running tests not using a launcher should know what he is doing.
History
Date User Action Args
2017-03-04 23:26:00stefan.richthofersetmessageid: <1488669960.88.0.496352173084.issue2559@psf.upfronthosting.co.za>
2017-03-04 23:26:00stefan.richthofersetrecipients: + stefan.richthofer, zyasoft, jeff.allen, jamesmudd
2017-03-04 23:26:00stefan.richthoferlinkissue2559 messages
2017-03-04 23:26:00stefan.richthofercreate