passing directories between trackers and extra tests
Problem:
When stages of processing files involve reading and writing, each stage can return a path(s) to save time. But as of right now, Temp would clean up the returned path(s) (assuming they were tracked), so returning them becomes useless.
Solution
Implement a method, handoff(paths, heir_pid), to pass tracking of path(s) to a tracker at heir_pid. This ensures that the paths will always be cleaned up if the process whose tracker is heir_pid dies.
Extra tests
Tests testing existing functionality:
"automatically cleans up" Make an untracked directory, then track it in a different process. Refute that the directory exists after awaiting the process than waiting for 50ms. "automatically cleans up after crashes" Same as "automatically cleans up", but the process crashes due to a match error.
Testing handoff
Assert that the tracker for the testing process is empty.
Make and track a directory in a separate process, then hand off the directory to the tracker for the testing process.
Assert that the directory is tracked under the tracker for the testing process and that it still exists.
Cleanup the tracker
Do the same for a process that crashes, but only refute that the set of tracked directories is empty. We know for sure that the directory inside the set is the one made by the task we started with Task.start.