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

Use 'sinon' for fake timers in tests #1439

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

fullkomnun
Copy link
Contributor

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

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:

  1. NF_SERVICES_TO_START=blockchain,client,deployer,mongodb,optimist,rabbitmq,worker ./bin/setup-nightfall
  2. NF_SERVICES_TO_START=blockchain,client,deployer,mongodb,optimist,rabbitmq,worker CONFIRMATIONS=1 WHITELISTING=disable ./bin/start-nightfall -g -d
    [in another terminal]
  3. docker wait nightfall_3_deployer_1 (wait for deployer to finish)
  4. CONFIRMATIONS=1 npm run test-periodic-payment

Any other comments?

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.

1 participant