Skip to content
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

Recording to the same cassette from several threads #5

Open
zudov opened this issue May 28, 2018 · 0 comments
Open

Recording to the same cassette from several threads #5

zudov opened this issue May 28, 2018 · 0 comments

Comments

@zudov
Copy link
Contributor

zudov commented May 28, 2018

Currently, as soon as withCassette finishes it dumps the accumulated cassettes to it's FilePath. This of course means that if several threads are recording to cassette which should be on the same path they'll overwrite each other. This is a common scenario as tests are often run in parallel.

  • Regardless of the solution, the thing should be more paranoid and error out if somebody have touched the file while it was running and it doesn't know hot to handle it.
  • If several recorders are writing to the same cassette those interactions should be merged together. This can be done either when
    • we save the cassette, by noticing that somebody have written to the file after we have started, reading that file and merging with it; or when
    • we add new recordings, by sharing the cassette for multiple threads if they are binded to the same path
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

No branches or pull requests

1 participant