setmocktime RPC command for regression testing #5280

pull gavinandresen wants to merge 3 commits into bitcoin:master from gavinandresen:regtest_set_blocktimes changing 6 files +45 −8
  1. gavinandresen commented at 2:36 PM on November 14, 2014: contributor

    Two changes:

    Adds a -regtest-only-mode setmocktime timestamp RPC call that causes all subsequent internal GetTime() calls to return that time. This uses the same code as some of the unit tests; it will let us do more thorough testing of scenarios with peers that have different notions of the current time.

    The last commit modifies the regression test initial blockchain (stored in the qa/rpc-tests/cache/ directory) so those blocks are created with fixed, known timestamps (will be important for code that tests difficulty adjustment / re-org scenarios).

    Builds on #5275

  2. sipa commented at 2:42 PM on November 17, 2014: member

    utACK the "regression test only setmocktime RPC call" commit, but please get working tests :)

  3. gavinandresen force-pushed on Nov 17, 2014
  4. regression test only setmocktime RPC call a8b2ce557d
  5. gavinandresen force-pushed on Nov 17, 2014
  6. gavinandresen commented at 5:23 PM on November 17, 2014: contributor

    Sigh... mingw32 and 64 were both failing, I pushed a no-change to get travis to re-run, now just one of them is failing (timing out during tests)...

  7. theuni commented at 7:04 PM on November 17, 2014: member

    @gavinandresen Until we get to the bottom of the flaky rpc tests w/ wine, you may want to pull in https://github.com/theuni/bitcoin/commit/bcf4cfe2f1a32bfa285ed34b9e334df434f146c3 .

  8. RPC tests: create initial chain with specific timestamps
    Use setmocktime to create the initial block chain with
    10-minute-apart-blocks starting 1 Jan 2014.
    daf03e7c92
  9. travis: disable rpc tests for windows until they're not so flaky 3c30f27f34
  10. gavinandresen force-pushed on Nov 17, 2014
  11. sipa commented at 1:46 PM on November 18, 2014: member

    utACK

  12. gavinandresen merged this on Nov 18, 2014
  13. gavinandresen closed this on Nov 18, 2014

  14. gavinandresen referenced this in commit fd3777b0b2 on Nov 18, 2014
  15. gavinandresen deleted the branch on Nov 18, 2014
  16. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-14 21:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me