What does this implement/fix? Explain your changes.
periodic-payment-test is currently the e2e tests that has the longest runtime (~ 1h)
Most time is spent waiting for 'node-cron', however instead this test can use 'sinon' for faking timers for granular control over timers for testing all kinds of use-cases and avoiding tests relaying on waiting which can lead to flacky test and/or excessive waiting
What does this implement/fix? Explain your changes.
Does this close any currently open issues?
Nope
What commands can I run to test the change?
Run 'periodic-payment-test' locally and/or in ci:
NF_SERVICES_TO_START=blockchain,client,deployer,mongodb,optimist,rabbitmq,worker ./bin/setup-nightfall
NF_SERVICES_TO_START=blockchain,client,deployer,mongodb,optimist,rabbitmq,worker CONFIRMATIONS=1 WHITELISTING=disable ./bin/start-nightfall -g -d
[in another terminal]docker wait nightfall_3_deployer_1
(wait for deployer to finish)CONFIRMATIONS=1 npm run test-periodic-payment
Any other comments?
@sinonjs/fake-timers
directly instead