Skip to content

Conversation

kyri-petrou
Copy link
Contributor

This PR is to make things a bit more DX friendly by:

  1. removing a lot of unnecessary logging / printing to console that happens during test execution
  2. reduces execution time for some tests that are taking too long (> 5-10 seconds in some cases)

@kyri-petrou kyri-petrou requested a review from hearnadam May 27, 2025 19:00
Copy link
Collaborator

@hearnadam hearnadam left a comment

Choose a reason for hiding this comment

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

Thanks!

@@ -34,7 +34,7 @@ object OneShotSpec extends ZIOBaseSpec {
test("get must fail if no value is set") {
val oneShot = OneShot.make[Object]

assert(oneShot.get(10000L))(throwsA[Error])
assert(oneShot.get(10L))(throwsA[Error])
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this because 10000 allocates, but 10 does not?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is the timeout waiting for a value. The test checks that if OneShot is not completed it will timeout and throw and error. Previously the timeout was set to 10 seconds which meant the suite simply had to wait for 10 seconds before completing, now it has to wait just 10ms

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah lol, not sure what I was thinking.

@@ -201,7 +201,7 @@ object TestProvideSpec extends ZIOBaseSpec {
} yield IntService(ref))

val stringService: ULayer[StringService] =
ZLayer(Ref.make("Hello").map(StringService(_)).debug("MAKING"))
ZLayer(Ref.make("Hello").map(StringService(_)))
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think there are some layers that use println directly as well...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Those ones are coming from the typeCheck macro but I can't for the life of me figure out where the printing is happening :/ It looks like it only happens when type-checking the result of macros

@kyri-petrou kyri-petrou merged commit 9be308b into zio:series/2.x May 28, 2025
18 checks passed
@kyri-petrou kyri-petrou deleted the improve-tests branch May 28, 2025 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants