Bug - Fixed CalendarFrameTest failing

fewyn

Administrator
Staff member
Looks like CalendarFrameTest has been failing most of the day on Jenkins.

Bash:
Started by user fewyn
Obtained jenkinsfile from git https://github.com/kolmafia/kolmafia.git
[Pipeline] Start of Pipeline
[Pipeline] node
Running on Jenkins in /var/lib/jenkins/workspace/Kolmafia
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Declarative: Checkout SCM)
[Pipeline] checkout
The recommended git tool is: git
No credentials specified
 > git rev-parse --resolve-git-dir /var/lib/jenkins/workspace/Kolmafia/.git # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url https://github.com/kolmafia/kolmafia.git # timeout=10
Fetching upstream changes from https://github.com/kolmafia/kolmafia.git
 > git --version # timeout=10
 > git --version # 'git version 2.34.1'
 > git fetch --tags --force --progress -- https://github.com/kolmafia/kolmafia.git +refs/heads/*:refs/remotes/origin/* # timeout=10
 > git rev-parse refs/remotes/origin/main^{commit} # timeout=10
Checking out Revision d124071825a3051e35985f1b8ea927b12bf3f4bf (refs/remotes/origin/main)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f d124071825a3051e35985f1b8ea927b12bf3f4bf # timeout=10
Commit message: "refactor: split ModifierDatabase from Modifiers (#1467)"
 > git rev-list --no-walk d124071825a3051e35985f1b8ea927b12bf3f4bf # timeout=10
The recommended git tool is: git
No credentials specified
 > git rev-parse HEAD^{commit} # timeout=10
The recommended git tool is: git
No credentials specified
[GitCheckoutListener] Recording commits of 'git https://github.com/kolmafia/kolmafia.git'
[GitCheckoutListener] Found previous build 'Kolmafia #1947' that contains recorded Git commits
[GitCheckoutListener] -> Starting recording of new commits since 'd124071'
[GitCheckoutListener] -> Single parent commit found - branch is already descendant of target branch head
[GitCheckoutListener] -> Using head commit 'd124071' as starting point
[GitCheckoutListener] -> No new commits found
[GitCheckoutListener] -> Git commit decorator successfully obtained 'hudson.plugins.git.browser.GithubWeb@242de4e1' to render commit links
[Pipeline] }
[Pipeline] // stage
[Pipeline] withEnv
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Git Update)
[Pipeline] cleanWs
[WS-CLEANUP] Deleting project workspace...
[WS-CLEANUP] Deferred wipeout is used...
[WS-CLEANUP] done
[Pipeline] script
[Pipeline] {
[Pipeline] checkout
The recommended git tool is: git
No credentials specified
Cloning the remote Git repository
Using shallow clone with depth 1000000
Cloning repository https://github.com/kolmafia/kolmafia
 > git init /var/lib/jenkins/workspace/Kolmafia # timeout=10
Fetching upstream changes from https://github.com/kolmafia/kolmafia
 > git --version # timeout=10
 > git --version # 'git version 2.34.1'
 > git fetch --tags --force --progress --depth=1000000 -- https://github.com/kolmafia/kolmafia +refs/heads/*:refs/remotes/origin/* # timeout=10
 > git config remote.origin.url https://github.com/kolmafia/kolmafia # timeout=10
 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
Avoid second fetch
 > git rev-parse refs/remotes/origin/main^{commit} # timeout=10
Checking out Revision d124071825a3051e35985f1b8ea927b12bf3f4bf (refs/remotes/origin/main)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f d124071825a3051e35985f1b8ea927b12bf3f4bf # timeout=10
Commit message: "refactor: split ModifierDatabase from Modifiers (#1467)"
[GitCheckoutListener] Skipping recording, since SCM 'git https://github.com/kolmafia/kolmafia' already has been processed
[Pipeline] }
[Pipeline] // script
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Building)
[Pipeline] timeout
Timeout set to expire in 15 min
[Pipeline] {
[Pipeline] script
[Pipeline] {
[Pipeline] sh
+ ls
CONTRIBUTING.md
LICENSE.md
README.md
build.gradle
data
devdoc
gradle
gradle.properties
gradlew
gradlew.bat
jenkinsfile
lib
settings.gradle
src
test
util
[Pipeline] sh
+ java --version
openjdk 17.0.6 2023-01-17
OpenJDK Runtime Environment Temurin-17.0.6+10 (build 17.0.6+10)
OpenJDK 64-Bit Server VM Temurin-17.0.6+10 (build 17.0.6+10, mixed mode, sharing)
[Pipeline] sh
+ ./gradlew -v

------------------------------------------------------------
Gradle 7.6
------------------------------------------------------------

Build time:   2022-11-25 13:35:10 UTC
Revision:     daece9dbc5b79370cc8e4fd6fe4b2cd400e150a8

Kotlin:       1.7.10
Groovy:       3.0.13
Ant:          Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM:          17.0.6 (Eclipse Adoptium 17.0.6+10)
OS:           Linux 5.15.0-58-generic amd64

[Pipeline] sh
+ ./gradlew --no-daemon clean shadowJar
To honour the JVM settings for this build a single-use Daemon process will be forked. See https://docs.gradle.org/7.6/userguide/gradle_daemon.html#sec:disabling_the_daemon.
Daemon will be stopped at the end of the build
> Task :cleanDist SKIPPED
> Task :clean
> Task :compileLibJava FROM-CACHE
> Task :compileJava FROM-CACHE
> Task :processResources
> Task :classes

> Task :getRevision

Revision: 27125

> Task :pruneDist SKIPPED
> Task :shadowJar FROM-CACHE

BUILD SUCCESSFUL in 19s
6 actionable tasks: 3 executed, 3 from cache
[Pipeline] }
[Pipeline] // script
[Pipeline] }
[Pipeline] // timeout
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Testing)
[Pipeline] timeout
Timeout set to expire in 15 min
[Pipeline] {
[Pipeline] script
[Pipeline] {
[Pipeline] sh
+ ./gradlew --no-daemon jacocoTestReport
To honour the JVM settings for this build a single-use Daemon process will be forked. See https://docs.gradle.org/7.6/userguide/gradle_daemon.html#sec:disabling_the_daemon.
Daemon will be stopped at the end of the build
> Task :compileLibJava UP-TO-DATE
> Task :compileJava FROM-CACHE
> Task :processResources UP-TO-DATE
> Task :classes UP-TO-DATE
> Task :compileTestJava FROM-CACHE
> Task :processTestResources
> Task :testClasses

> Task :test
OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended

GitManagerTest > DeletionSuccess STANDARD_ERROR
    SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
    SLF4J: Defaulting to no-operation (NOP) logger implementation
    SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

CalendarFrameTest > itShouldCalculateExpectedEventsForKnownTime() FAILED
    java.awt.HeadlessException at CalendarFrameTest.java:262

CalendarFrameTest > calendarFrameShouldHaveBasicFunctionality() FAILED
    java.awt.HeadlessException at CalendarFrameTest.java:234

CalendarFrameTest > itShouldCalculateExpectedCalendarDataForWhiteWednesday() FAILED
    java.awt.HeadlessException at CalendarFrameTest.java:276

CalendarFrameTest > itShouldCalculateExpectedCalendarDataForKnownTime() FAILED
    java.awt.HeadlessException at CalendarFrameTest.java:248

4485 tests completed, 4 failed, 9 skipped

> Task :test FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':test'.
> There were failing tests. See the report at: file:///var/lib/jenkins/workspace/Kolmafia/build/reports/tests/test/index.html

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 4m 24s
6 actionable tasks: 2 executed, 2 from cache, 2 up-to-date
[Pipeline] }
[Pipeline] // script
[Pipeline] }
[Pipeline] // timeout
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Archiving)
Stage "Archiving" skipped due to earlier failure(s)
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: script returned exit code 1
Finished: FAILURE
 

fronobulax

Developer
Staff member
Also see https://kolmafia.us/threads/r27122-calendarframe-test-by-jaadams5-in-u.28539/

java.awt.HeadlessException in this context is a problem with the environment, not the test as such. The gradle change that added xvfb fixed this on Ubuntu on GitHub. It never failed on Windows locally or on GitHub. MaxOS passed on GitHub. So my expectation is that there is a difference in the Jenkins and the GitHub environments in terms of X11 support or the use of xvfb.

We can certainly disable the test but I really think the environment is where the adjustment should be made.

Thanks.
 

heeheehee

Developer
Staff member
There's a jenkinsfile in the repo, right?


Any reason why we couldn't use xvfb-run there too? (other than needing to install xvfb on fewyn's server if it's not already there)
 

fewyn

Administrator
Staff member
Yes it needs xfdb installed on the server and the Jenkins file updated which o should be able to do in the morning.
 
Top