nick8325 / nick8325/quickcheck

Combining shrinking with resource usage is seemingly unsupported.

Open
#331 12 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Haskell
Stars
790
Forks
130
Avg merge
16h 41m
Merged PRs (30d)
2

Description

Ref https://github.com/hspec/hspec/issues/531

It looks like quickcheck assumes that properties don't use any resources while they are being tested.

In particular reduceRose is called before starting shrinking: https://github.com/nick8325/quickcheck/blob/2dcfbf6170d58f993a53159c24e2549744c9cf2a/src/Test/QuickCheck/Test.hs#L349
This uses the assumption that the IO actions in IORose don't clean up resources that could affect the outcome of a test. (I think, please correct me if I'm wrong.)

Is this fixable? If not I might have to write my own Property tester to support this use-case.

Contributor guide

No contributing guide indexed for this repository

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

Read src/Test/QuickCheck/Test.hs around reduceRose and the IORose behavior described, then review the referenced hspec issue 531. Determine whether resource cleanup during shrinking can be supported without changing property semantics; done means establishing supported behavior or documenting the limitation clearly.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
testing-qa
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.