-
Notifications
You must be signed in to change notification settings - Fork 74
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
Update to Java 17 #4307
Update to Java 17 #4307
Changes from 9 commits
a05549e
581c070
1b26b19
00a0630
44dd5e5
f1b7211
891db0c
41d879b
676bc36
3974cc4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
package ch.epfl.bluebrain.nexus.delta.plugins.blazegraph.slowqueries | ||
|
||
import ch.epfl.bluebrain.nexus.delta.plugins.blazegraph.slowqueries.BlazegraphSlowQueryStoreSuite._ | ||
import ch.epfl.bluebrain.nexus.delta.plugins.blazegraph.slowqueries.model.BlazegraphSlowQuery | ||
import ch.epfl.bluebrain.nexus.delta.rdf.IriOrBNode.Iri | ||
import ch.epfl.bluebrain.nexus.delta.rdf.query.SparqlQuery | ||
import ch.epfl.bluebrain.nexus.delta.sdk.views.ViewRef | ||
import ch.epfl.bluebrain.nexus.delta.sourcing.model.{Identity, Label, ProjectRef} | ||
import ch.epfl.bluebrain.nexus.delta.sourcing.postgres.Doobie | ||
import ch.epfl.bluebrain.nexus.testkit.IOFixedClock | ||
import ch.epfl.bluebrain.nexus.testkit.bio.BioSuite | ||
import ch.epfl.bluebrain.nexus.delta.sourcing.postgres.Doobie | ||
import munit.AnyFixture | ||
|
||
import java.time.temporal.ChronoUnit | ||
import java.time.{Duration, Instant} | ||
import scala.concurrent.duration.DurationInt | ||
import BlazegraphSlowQueryStoreSuite._ | ||
|
||
class BlazegraphSlowQueryStoreSuite | ||
extends BioSuite | ||
|
@@ -31,7 +32,7 @@ class BlazegraphSlowQueryStoreSuite | |
SparqlQuery(""), | ||
failed = true, | ||
1.second, | ||
Instant.now(), | ||
Instant.now().truncatedTo(ChronoUnit.MILLIS), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
https://docs.oracle.com/javase/8/docs/api/java/time/Clock.html#systemUTC-- Based on this perhaps calls to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think in production code we are safe, as we should never be calling One possible solution is to be a bit more relaxed in tests. I know that we use a fixed clock and check exact timestamps, but an alternative approach is to use a normal clock be a little more flexible. That is probably too big a change though Perhaps there is some sort of typeclass equality that could rescue us..? |
||
Identity.User("Ted Lasso", Label.unsafe("epfl")) | ||
) | ||
|
||
|
@@ -69,7 +70,7 @@ object BlazegraphSlowQueryStoreSuite { | |
) | ||
} | ||
|
||
private val Now = Instant.now() | ||
private val Now = Instant.now().truncatedTo(ChronoUnit.MILLIS) | ||
private val OneWeekAgo = Now.minus(Duration.ofDays(7)) | ||
private val EightDaysAgo = Now.minus(Duration.ofDays(8)) | ||
private val RecentQuery = queryAtTime(Now) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you necessarily have to do it in this PR, but here is something interesting: https://github.com/marketplace/actions/setup-java-jdk#caching-sbt-dependencies
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tried it but for some reason it takes ages to recover the cache. Example: https://github.com/BlueBrain/nexus/actions/runs/6318630985/job/17158027837 It takes 2m45 to fetch the cache but doesn't speed up the actual build/tests 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw there is caching added to the release and snapshot pipelines to try it out. My suspicion is that it should work ok on the cloud runners. If it is also slow I will remove it.