tests: Print dots by default in functional tests #14569

pull ken2812221 wants to merge 1 commits into bitcoin:master from ken2812221:travis-avoid-timeout changing 1 files +10 −14
  1. ken2812221 commented at 12:34 PM on October 25, 2018: contributor

    In cron job (https://travis-ci.org/bitcoin/bitcoin/builds/445823485), the functional tests would fail due to silent for 10 mins.

    After applying this patch, we con't see any extra characters printed on screen but also avoid timeout (https://travis-ci.org/ken2812221/bitcoin/builds/445981698)

  2. fanquake added the label Tests on Oct 25, 2018
  3. laanwj commented at 12:53 PM on October 25, 2018: member

    For this reason the test runner prints . every so few seconds, but somehow—that's no longer enough?

  4. MarcoFalke commented at 12:57 PM on October 25, 2018: member

    This is probably due to if self.logging_level == logging.DEBUG: from #14504. Imo that condition can be removed.

  5. DrahtBot commented at 10:47 PM on October 27, 2018: member

    <!--e57a25ab6845829454e8d69fc972939a-->No more conflicts as of last run.

  6. ken2812221 renamed this:
    travis: Print characters per 9 min to avoid timeout
    travis: Print empty characters per 9 min to avoid timeout
    on Oct 27, 2018
  7. ken2812221 force-pushed on Oct 29, 2018
  8. ken2812221 commented at 7:44 AM on October 29, 2018: contributor

    @MarcoFalke Is this what you mean or just remove the if condition to always print .?

  9. ken2812221 force-pushed on Oct 29, 2018
  10. MarcoFalke commented at 11:07 AM on October 29, 2018: member

    Previously there was no condition, and it would always print: https://github.com/bitcoin/bitcoin/pull/14504/files?w=1#diff-a5b9b84e3a3387476629e74ddb227a7eR502

    Not sure why that got added.

  11. Gnappuraz commented at 11:39 AM on October 29, 2018: contributor

    @ken2812221 don't you have to kill the waiting at some point since you put it on background? Also I think that travis has a 10m timeout, so printing every 9m should cut it. I've done something like this to avoid it while running the tests...

    if [ "$RUN_TESTS" = "true" ]; then
      while sleep 9m; do echo "=====[ $SECONDS seconds still running ]====="; done &
      make $MAKEJOBS check VERBOSE=1
      kill %1
    fi
    
  12. isghe commented at 1:03 PM on October 29, 2018: contributor

    Previously there was no condition, and it would always print: https://github.com/bitcoin/bitcoin/pull/14504/files?w=1#diff-a5b9b84e3a3387476629e74ddb227a7eR502

    Not sure why that got added.

    To be coherent with --quiet option "only print results summary and failure logs". @ken2812221 Maybe we can add the --dots option to show the dots. So the travis command could be DOCKER_EXEC test/functional/test_runner.py --combinedlogslen=4000 --coverage --quiet --failfast --dots ${extended};

    or the --travis option.

  13. in test/functional/test_runner.py:506 in be42d2cf58 outdated
     499 | -                        print(clearline, end='', flush=True)
     500 | -                        dot_count = 0
     501 |                      return TestResult(name, status, int(time.time() - start_time)), testdir, stdout, stderr
     502 | -            if self.logging_level == logging.DEBUG:
     503 | -                print('.', end='', flush=True)
     504 | -                dot_count += 1
    


    MarcoFalke commented at 1:40 PM on October 29, 2018:

    I think it was nice to have some indicator that something was running. I'd prefer to keep it.


    isghe commented at 1:48 AM on October 30, 2018:

    I agree: running functional tests, without any progress indicator, it's not a good incentive to run functional tests.

  14. ken2812221 force-pushed on Oct 30, 2018
  15. ken2812221 renamed this:
    travis: Print empty characters per 9 min to avoid timeout
    tests: Print dots to avoid timeout when --dots given
    on Oct 30, 2018
  16. ken2812221 force-pushed on Oct 30, 2018
  17. Gnappuraz approved
  18. Gnappuraz commented at 9:12 AM on October 30, 2018: contributor

    utACK 2e4435c

  19. in test/functional/test_runner.py:446 in 2e4435ce2d outdated
     442 | @@ -441,7 +443,7 @@ class TestHandler:
     443 |      Trigger the test scripts passed in via the list.
     444 |      """
     445 |  
     446 | -    def __init__(self, num_tests_parallel, tests_dir, tmpdir, test_list=None, flags=None, logging_level=logging.DEBUG):
     447 | +    def __init__(self, num_tests_parallel, tests_dir, tmpdir, test_list=None, flags=None, logging_level=logging.DEBUG, dots=False):
    


    MarcoFalke commented at 12:12 PM on October 30, 2018:

    self.logging_level is now unused. I'd slightly prefer to remove it.

  20. in test/functional/test_runner.py:228 in 2e4435ce2d outdated
     224 | @@ -225,6 +225,7 @@ def main():
     225 |      parser.add_argument('--quiet', '-q', action='store_true', help='only print results summary and failure logs')
     226 |      parser.add_argument('--tmpdirprefix', '-t', default=tempfile.gettempdir(), help="Root directory for datadirs")
     227 |      parser.add_argument('--failfast', action='store_true', help='stop execution after the first test failure')
     228 | +    parser.add_argument('--dots', action='store_true', help='print dots while testing to avoid silence timeout on travis-ci.')
    


    MarcoFalke commented at 12:14 PM on October 30, 2018:

    Is it really necessary to add an option to enable a feature that should be on by default? I think the average user would prefer to see dots without having to enable them by typing --dots every time.

  21. in test/functional/test_runner.py:225 in 2e4435ce2d outdated
     224 | @@ -225,6 +225,7 @@ def main():
     225 |      parser.add_argument('--quiet', '-q', action='store_true', help='only print results summary and failure logs')
    


    MarcoFalke commented at 12:15 PM on October 30, 2018:
        parser.add_argument('--quiet', '-q', action='store_true', help='only print dots, results summary and failure logs')
    

    MarcoFalke commented at 12:15 PM on October 30, 2018:

    Could just add dots here and remove the other option?

  22. MarcoFalke commented at 12:16 PM on October 30, 2018: member

    Sorry for nitpicking this trivial change to death. Feel free to ignore my feedback.

  23. ken2812221 force-pushed on Oct 30, 2018
  24. tests: Print dots by default 4bd125fff0
  25. ken2812221 force-pushed on Oct 30, 2018
  26. ken2812221 renamed this:
    tests: Print dots to avoid timeout when --dots given
    tests: Print dots by default in functional tests
    on Oct 31, 2018
  27. ken2812221 commented at 3:19 AM on October 31, 2018: contributor

    @MarcoFalke Now it print dots by default.

  28. MarcoFalke commented at 9:03 AM on October 31, 2018: member

    utACK 4bd125fff080d1d1f20d0259836d55bb685be6d2

  29. fanquake commented at 1:17 PM on October 31, 2018: member

    utACK 4bd125f

  30. jnewbery commented at 2:43 PM on November 1, 2018: member

    Seems reasonable. The whole point of quiet mode was to not fill the screen with output. Now that the dots erase themselves after each test, that's no longer an issues.

    Tested ACK 4bd125fff080d1d1f20d0259836d55bb685be6d2

  31. MarcoFalke merged this on Nov 1, 2018
  32. MarcoFalke closed this on Nov 1, 2018

  33. MarcoFalke referenced this in commit 6a095bc5f2 on Nov 1, 2018
  34. ken2812221 deleted the branch on Nov 1, 2018
  35. Fuzzbawls referenced this in commit 918852cb90 on Jul 11, 2019
  36. Munkybooty referenced this in commit 719ebf6277 on Jun 24, 2021
  37. Munkybooty referenced this in commit 3ec1a6c6d1 on Jun 24, 2021
  38. Munkybooty referenced this in commit 89c0be5ce0 on Jun 27, 2021
  39. Munkybooty referenced this in commit c443477e08 on Jun 28, 2021
  40. Munkybooty referenced this in commit 5d38c82f6e on Jun 28, 2021
  41. Munkybooty referenced this in commit 1d36e10a25 on Jun 29, 2021
  42. Munkybooty referenced this in commit a5f0708c86 on Jun 29, 2021
  43. Munkybooty referenced this in commit 7d944a77e4 on Jun 29, 2021
  44. 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-20 09:15 UTC

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