typelevel / typelevel/fs2

`fs2.interop.flow.PublisherToSubscriberSpec.should cancel upstream if downstream completes` flake

Open
#3,542 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Scala
Stars
2.5k
Forks
636
Avg merge
2d 4h
Merged PRs (30d)
7

Description

3b56691a0830580ea113ef391c2fc169a6f17b97

ubuntu-latest, 3, temurin@17, rootJVM

Unfortunately, ScalaCheck minimized the buffer size argument to zero, which is invalid, so I think we lost the original error ...

==> X fs2.interop.flow.PublisherToSubscriberSpec.should cancel upstream if downstream completes  0.565s munit.FailException: Failing seed: 82KDw0NDjWAXJUVVYTrYStmnTfKrZEE9oA8wbVXJAuG=
You can reproduce this failure by adding the following override to your suite:

  override def scalaCheckInitialSeed = "82KDw0NDjWAXJUVVYTrYStmnTfKrZEE9oA8wbVXJAuG="

Exception raised on property evaluation.
> ARG_0: List(2147483647)
> ARG_1: List(923319774, 2147483647, -140306582, 2147483647, -2147483648, 1239258450, -154613030)
> ARG_2: 0
> ARG_2_ORIGINAL: 41
> Exception: java.lang.IllegalArgumentException: requirement failed: The buffer size MUST be positive
    at munit.Assertions.fail(Assertions.scala:256)
    at munit.Assertions.fail$(Assertions.scala:16)
    at munit.FunSuite.fail(FunSuite.scala:11)
    at munit.ScalaCheckEffectSuite.munit$ScalaCheckEffectSuite$$parseTestResult(ScalaCheckEffectSuite.scala:80)
    at munit.ScalaCheckEffectSuite.checkPropF$$anonfun$2(ScalaCheckEffectSuite.scala:68)
    at apply @ munit.CatsEffectAssertions.assertIO$$anonfun$1(CatsEffectAssertions.scala:52)
    at flatMap @ fs2.Compiler$Target.flatMap(Compiler.scala:163)
    at flatMap @ fs2.Compiler$Target.flatMap(Compiler.scala:163)
    at flatMap @ fs2.Compiler$Target.flatMap(Compiler.scala:163)
    at flatMap @ fs2.Compiler$Target.flatMap(Compiler.scala:163)
    at flatMap @ fs2.Compiler$Target.flatMap(Compiler.scala:163)
    at flatMap @ fs2.Compiler$Target.flatMap(Compiler.scala:163)
    at modify @ fs2.internal.Scope.open$$anonfun$1(Scope.scala:149)
    at flatMap @ fs2.Compiler$Target.flatMap(Compiler.scala:163)
    at uncancelable @ fs2.Compiler$Target.uncancelable(Compiler.scala:165)
    at rethrow$extension @ fs2.Compiler$Target.compile$$anonfun$1(Compiler.scala:157)
    at get @ fs2.internal.Scope.openScope(Scope.scala:278)
    at flatMap @ fs2.Compiler$Target.flatMap(Compiler.scala:163)
    at flatMap @ fs2.Compiler$Target.flatMap(Compiler.scala:163)
    at flatMap @ fs2.Pull$.fs2$Pull$$$_$interruptGuard$1(Pull.scala:951)

https://github.com/typelevel/fs2/actions/runs/13606087216/job/38037727735#step:11:3612

cc @BalmungSan

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the named fs2.interop.flow.PublisherToSubscriberSpec failure with ScalaCheck seed 82KDw0NDjWAXJUVVYTrYStmnTfKrZEE9oA8wbVXJAuG=. Inspect the property inputs around the buffer size, especially the minimized zero versus original 41. Done means the test no longer flakes while retaining the upstream-cancellation check and rejecting invalid buffer sizes.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.