RFR: 7903961: Make default timeout configurable

Christian Stein cstein at openjdk.org
Tue Apr 1 09:46:41 UTC 2025


On Tue, 1 Apr 2025 09:33:04 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:

>> Please review this change replacing the hard-coded `120` seconds default timeout for test actions with a configurable solution parsing a custom default value from `TEST.ROOT` and `TEST.properties` files:
>> 
>> 
>> timeout.default.seconds=360
>> 
>> 
>> Especially in combination with "JUnit.dirs" and "TestNG.dirs", where all actions directives found in a test file are ignored, is helpful.
>
> src/share/classes/com/sun/javatest/regtest/exec/RegressionScript.java line 1178:
> 
>> 1176:         if (isTimeoutsEnabled()) {
>> 1177:             long seconds = properties.getDefaultTimeout(getTestDescription().getFile()).toSeconds();
>> 1178:             p.put("test.timeout.default.seconds", Long.toString(seconds));
> 
> Is this the properties that get advertised to the application's test code? I'm guessing it is because I see that the `tag-spec` documentation has been updated to mention that this property will be made available to the test code. 
> 
> Is there a reason why the test code would be interested in this default value? As far as I can see we don't expose the final evaluated timeout value nor do we expose any other default configuration values (like the `defaultExecMode`) as properties to the test code. So it might be better not to expose this at least until it is really necessary.

jtreg already exports the following timeout-related system property:
> `test.timeout.factor`	`TESTTIMEOUTFACTOR`	_The timeout factor to be applied to the default timeout for the test._
https://openjdk.org/jtreg/tag-spec.html#testvars

Test code and also test frameworks may want to adjust their bevaviour according both of these values. For example, having a test method-bound timeout or an assertion-based timeout makes more sense when the test author may react on the outer boundaries communicated by jtreg.

-------------

PR Review Comment: https://git.openjdk.org/jtreg/pull/253#discussion_r2022520892


More information about the jtreg-dev mailing list