Skip to content

Commit

Permalink
CLDR-17304: quell some test errs
Browse files Browse the repository at this point in the history
- add a logKnownIssue on CLDR-17320
- add a return to CheckCLDR.setLoggerLevel() so we can do save/restore level
  • Loading branch information
srl295 committed Jan 22, 2024
1 parent 39da77a commit c72beba
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckCLDR.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,17 @@ public abstract class CheckCLDR implements CheckAccessor {
/** protected so subclasses can use it */
protected static Logger logger = Logger.getLogger(CheckCLDR.class.getSimpleName());

/** set the internal logger level. For ConsoleCheck. */
public static void setLoggerLevel(java.util.logging.Level newLevel) {
/**
* set the internal logger level. For ConsoleCheck.
*
* @returns the previous level
*/
public static java.util.logging.Level setLoggerLevel(java.util.logging.Level newLevel) {
// NB: we use the full package name here, to avoid conflict with other CLDR classes named
// Level
java.util.logging.Level oldLevel = logger.getLevel();
logger.setLevel(newLevel);
return oldLevel;
}

/** serialize CheckCLDR as just its class name */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,12 @@ public void TestFullErrors() {
}

public void TestAllLocales() {
java.util.logging.Level oldLevel = null;
if (logKnownIssue(
"CLDR-17320",
"turning off CheckCLDR logging to avoid 2,000 log messages, please fix internal stack traces")) {
oldLevel = CheckCLDR.setLoggerLevel(java.util.logging.Level.OFF);
}
CheckCLDR test = CheckCLDR.getCheckAll(factory, INDIVIDUAL_TESTS);
CheckCLDR.setDisplayInformation(english);
Set<String> unique = new HashSet<>();
Expand All @@ -487,6 +493,9 @@ public void TestAllLocales() {
// (And in fact this test seems faster without it)
locales.forEach(locale -> checkLocale(test, locale, null, unique));
logln("Count:\t" + locales.size());
if (oldLevel != null) {
CheckCLDR.setLoggerLevel(oldLevel);
}
}

public void TestA() {
Expand Down

0 comments on commit c72beba

Please sign in to comment.