Skip to content
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

7903931: Add "test.thread.factory" property to filter tests based on test thread factory value #242

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -101,6 +101,11 @@ static RegressionContext getDefault() {
values.put("os.maxMemory", String.valueOf(os.maxMemory));
values.put("os.maxSwap", String.valueOf(os.maxSwap));

String testThreadFactory = (params == null || params.getTestThreadFactory() == null)
? "null"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having null as the value for "no test thread factory available" is right choice regarding easier handling on the use-site?

Or would skipping the values.put() call be a better default? 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't checked but it should be considered as a "invalid name" if we don't put any value.
Also, want to be consistent with other properties, that just have some default value, often "null".

: params.getTestThreadFactory();
values.put("test.thread.factory", testThreadFactory);

processVMOptions((params == null) ? Collections.<String>emptyList() : params.getTestVMJavaOptions());
}

Expand Down
3 changes: 2 additions & 1 deletion test/tag-spec/TestTagSpec.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -43,6 +43,7 @@ $(BUILDTESTDIR)/TestTagSpec_sysProps.ok: \
$(JAVAFILES.com.sun.javatest.regtest-tools)
$(GREP) -oh '\(.put(\|put(map, \)"test.[^"]*' $(JAVAFILES.com.sun.javatest.regtest-tools) | \
$(GREP) -v "test.class.path.prefix" | \
$(GREP) -v "test.thread.factory" | \
$(SED) -e 's/.*"//' | $(SORT) -u > $(@:%.ok=%.src)
$(GREP) -o '<code>test[^<]*</code>' $(JTREG_TAGSPEC) | \
$(SED) -e 's/<[^>]*>//g' | $(SORT) -u > $(@:%.ok=%.spec)
Expand Down