Skip to content

Add test_randomly - #19

Open
rmoehn wants to merge 1 commit into
oughtinc:masterfrom
rmoehn:test-randomly-2
Open

Add test_randomly#19
rmoehn wants to merge 1 commit into
oughtinc:masterfrom
rmoehn:test-randomly-2

Conversation

@rmoehn

Copy link
Copy Markdown
Contributor

For exercising Patchwork with random inputs.

Implementation notes:

  • I don't know if the code involving threading is correct.

  • Leave many TODOs, because doing them would good, but isn't crucial for
    the random test to be useful.

  • Some identifiers have a trailing underscore (hypothesis_) in order to
    avoid shadowing global variables.

  • One might think that starting a thread for every act() is slow, but on
    my machine, which is old, it increases the running time of the random
    test by only a few seconds (7 s → 8-12 s).

  • Someone in https://stackoverflow.com/questions/2829329/ advises to
    catch BaseException (instead of Exception) and re-raise in
    (Terminable)Thread.join. Don't do that, because a SystemExit in a
    child thread shouldn't terminate the parent, in my opinion.

  • Custom exception types are good. Cf.
    https://www.youtube.com/watch?v=wf-BqAjZb8M.

For exercising Patchwork with random inputs.
Implementation notes:
- I don't know if the code involving threading is correct.
- Leave many TODOs, because doing them would good, but isn't crucial for
the random test to be useful.
- Some identifiers have a trailing underscore (hypothesis_) in order to
avoid shadowing global variables.
- One might think that starting a thread for every act() is slow, but on
my machine, which is old, it increases the running time of the random
test by only a few seconds (7 s → 8-12 s).
- Someone in https://stackoverflow.com/questions/2829329/ advises to
catch BaseException (instead of Exception) and re-raise in
(Terminable)Thread.join. Don't do that, because a SystemExit in a
child thread shouldn't terminate the parent, in my opinion.
- Custom exception types are good. Cf.
https://www.youtube.com/watch?v=wf-BqAjZb8M.
@rmoehnrmoehn mentioned this pull request Aug 21, 2018
Sign up for freeto 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.

1 participant

@rmoehn