LT tests fail on macOS but succeed on Linux (same Java version, same version of LT)

Hi. The same version of LanguageTool (git tag 264449a14bd74d5fea4d4f1a7904997cf12fdd7d, which is the latest at the time I write this) builds fine on Linux (xubuntu-18.05.6) and all tests pass. However, on macOS Monterey 12.4, M1 processor, Polish tests fail:

$ mvn clean package
...snip...
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR] org.languagetool.rules.pl.PolishPatternRuleTest.testRules(org.languagetool.rules.pl.PolishPatternRuleTest)
[ERROR]   Run 1: PolishPatternRuleTest>PatternRuleTest.lambda$testGrammarRulesFromXML$1:382->PatternRuleTest.testBadSentences:503->PatternRuleTest.assertSuggestions:596->PatternRuleTest.addError:347 » PatternRuleTestFailure
[ERROR]   Run 2: PolishPatternRuleTest>PatternRuleTest.lambda$testGrammarRulesFromXML$1:382->PatternRuleTest.testBadSentences:503->PatternRuleTest.assertSuggestions:596->PatternRuleTest.addError:347 » PatternRuleTestFailure
[ERROR]   Run 3: PolishPatternRuleTest>PatternRuleTest.lambda$testGrammarRulesFromXML$1:382->PatternRuleTest.testBadSentences:503->PatternRuleTest.assertSuggestions:596->PatternRuleTest.addError:347 » PatternRuleTestFailure
[INFO]
[INFO]
[ERROR] Tests run: 31, Failures: 0, Errors: 1, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for LanguageTool 5.8-SNAPSHOT:
[INFO]
[INFO] LanguageTool ....................................... SUCCESS [  0.823 s]
[INFO] LanguageTool Style and Grammar Checker Core ........ SUCCESS [ 32.793 s]
[INFO] English module for LanguageTool .................... SUCCESS [01:10 min]
[INFO] Persian module for LanguageTool .................... SUCCESS [  4.076 s]
[INFO] Arabic module for LanguageTool ..................... SUCCESS [  9.602 s]
[INFO] French module for LanguageTool ..................... SUCCESS [ 54.422 s]
[INFO] German module for LanguageTool ..................... SUCCESS [02:07 min]
[INFO] Polish module for LanguageTool ..................... FAILURE [ 27.371 s]
[INFO] Catalan module for LanguageTool .................... SKIPPED
[INFO] Italian module for LanguageTool .................... SKIPPED
...snip...

I have no local changes. java -v reports the same version on Linux and macOS i.e.:

$ java -version
openjdk version "11.0.13" 2021-10-19
OpenJDK Runtime Environment Temurin-11.0.13+8 (build 11.0.13+8)
OpenJDK 64-Bit Server VM Temurin-11.0.13+8 (build 11.0.13+8, mixed mode)

Any idea what’s wrong and hint to debug this?
I can reproduce it 100% so I can provide more info on demand.

The installed Java on the M1 laptop currently uses x84_64 architecture (so uses Rosetta emulation) which makes it slower than on Linux. Eventually, I will use Java for armv8 which should make it faster. But I’d expect LT tests to pass on macOS regardless of the Java architecture.

In any case, I’m able to use LT successfully on both Linux or macOS despite test failures on macOS. I only use the command line LT via my Vim plugin GitHub - dpelle/vim-LanguageTool: A vim plugin for the LanguageTool grammar checker ). I have not tried the integration LibreOffice.

1 Like

Could you post the full output? There should be a more verbose error message in it, I think.

@dnaber asked

Could you post the full output?

Sure. I attach the full output of “mvn clean package” on macOS Monterey 12.3 M1 (which fails for Polish). This time I used git SHA1 d8cdf5762fe4f5e9ccd185cb7c9e002126ed5809 which is a little bit newer (latest at this time).

mvn-clean-package-on-macOS-M1-SHA1-d8cdf5762fe4.txt (139.3 KB)

Thanks. I’m not sure why that happens. Maybe you or someone with a similar setup can debug this and see what the reason might be? The code that makes the test fail starts in PatternRuleTest line 590.

This version of OpenJDK 11 is outdated. To rule out a possible cause of the error, you could try the current version 11.0.15, available for both x64 and aarch64.

:link: Adoptium | Latest releases OpenJDK 11

OpenJDK 17 and 18 are also available for both x64 and aarch64.

1 Like

This version of OpenJDK 11 is outdated. To rule out a possible cause of the error, you could try the current version 11.0.15, available for both x64 and aarch64.

Yes, I will try later and will report here.
I used those versions of OpenJDK because they came pre-installed on work macOS and Linux machines.