Skip to content

Update caching transport and tests#1617

Merged
mattjohnsonpint merged 16 commits into
mainfrom
simplify-caching-transport-tests
May 3, 2022
Merged

Update caching transport and tests#1617
mattjohnsonpint merged 16 commits into
mainfrom
simplify-caching-transport-tests

Conversation

@mattjohnsonpint

@mattjohnsonpint mattjohnsonpint commented Apr 29, 2022

Copy link
Copy Markdown
Contributor

Some improvements to the caching transport, mostly around tests:

  • Most of the tests immediately stop the worker and then flush it manually later. Add a boolean startWorker that can be set false on these tests to just not have a worker started to begin with.
  • Several tests didn't need a cache worker, and had one previously.
  • The AwareOfExistingFiles test was passing, but wasn't actually testing what we thought it was. It does now.
  • The WorksInBackground test was watching the directory to know when it was finished. Rewrote to watch an event fired on the inner transport. No need to watch the directory at all now.
  • On the caching transport itself, recovery of files left in processing was being done with the worker start. Moved this to initialization so that it always happens, even if the worker is shutting down or when there's not a worker. This mostly is for the test to pass, but is a good idea anyway.

@mattjohnsonpint mattjohnsonpint marked this pull request as draft April 30, 2022 01:29
@mattjohnsonpint

Copy link
Copy Markdown
Contributor Author

Looks like there's still a race condition in the AwareOfExistingFiles test. I'll come back to this...

@mattjohnsonpint mattjohnsonpint changed the title Update caching transport tests Update caching transport and tests Apr 30, 2022
@mattjohnsonpint mattjohnsonpint marked this pull request as ready for review April 30, 2022 18:57
@mattjohnsonpint mattjohnsonpint marked this pull request as draft April 30, 2022 19:21
@mattjohnsonpint

Copy link
Copy Markdown
Contributor Author

It's good at this point, but I see a few more related improvements to make. More coming shortly. 😉

@mattjohnsonpint mattjohnsonpint marked this pull request as ready for review April 30, 2022 22:15
@mattjohnsonpint

Copy link
Copy Markdown
Contributor Author

Good enough for now. Ready for review. Thanks.

@mattjohnsonpint mattjohnsonpint merged commit fe5b60b into main May 3, 2022
@mattjohnsonpint mattjohnsonpint deleted the simplify-caching-transport-tests branch May 3, 2022 00:35
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