Closed scottlowe closed 2 years ago
Whilst the tests seem a bit contrived - it's the best I could do.
Also: I was very surprised to discover that the existing write-scheduler tests don't actually start the write-loop in the write-scheduler! For a long time I couldn't understand why none of my tests were working or returning.
Fair enough - I think some of the higher level API calls that write to the DB effectively excercise this stuff, but the "coverage" that the drafter.write-scheduler-test
test namespace previously appeared to offer feels misleading to me.
Regardless, my additional tests do now actually start the write-scheduler.
Update: This pause control has been currently shelved following clarification in the issue here: https://github.com/Swirrl/drafter/issues/548#issuecomment-1227425832
I will rework this.
Following further discussion, this PR has been superceded by this new PR https://github.com/Swirrl/drafter/pull/634.
Addresses issue https://github.com/Swirrl/drafter/issues/538, and relates to issue https://github.com/Swirrl/drafter/issues/548. To play with this:
Start drafter ...
Starting drafter will automatically start a socket on port
5555
which can be used to pause / contunue Drafter's write-loop.Then use the simple
package/install/drafter-toggle-writing.sh
script pause / continue toggle function over the socket:You can view the logged effect with
tail -f drafter-test.log
.NOTE: there is a duplicate logging (timestamps are identical too) - it's seems to be an artifact of running the socket REPL: