Fix issue where travis does not show the ./tests seed… #685

pull jonasnick wants to merge 2 commits into bitcoin-core:master from jonasnick:fix-seed-output changing 2 files +15 −2
  1. jonasnick commented at 7:52 pm on November 2, 2019: contributor

    …by removing stdout buffering and always cat tests.log after a travis run. Fixes #645.

    I noticed that according to the doc tests.log should contain stdout as well as stderr. But it doesn’t because stdout isn’t flushed. I removed buffering completely to avoid having to call fflush twice.

    Travis is instructed to always show the seed which seems helpful with after_script by cating ./tests.log. In case the tests fail it looks like https://travis-ci.org/jonasnick/secp256k1/jobs/606446234.

  2. jonasnick force-pushed on Nov 2, 2019
  3. jonasnick cross-referenced this on Nov 2, 2019 from issue Add schnorrsig module which implements BIP-340 compliant signatures by jonasnick
  4. in src/tests.c:5211 in 1b9ec7a981 outdated
    5207@@ -5208,6 +5208,7 @@ int main(int argc, char **argv) {
    5208     }
    5209     secp256k1_rand_seed(seed16);
    5210 
    5211+    setbuf(stdout, NULL);
    


    real-or-random commented at 3:50 pm on November 3, 2019:
    C89 says setbuf should be called before any operation is performed on the stream. This means that it is currently in the right position but I think it would be less fragile to put at the beginning of main(). (For example, someone could have the idea of changing the fprintf(stderr, ...) in line 5195 to stdout.) Also, I think this call deserves a comment with a rationale.

    jonasnick commented at 10:36 pm on November 3, 2019:
    Good point. I moved the call to the beginning of main and added comments.
  5. real-or-random commented at 3:52 pm on November 3, 2019: contributor

    Thanks for picking up this issue, looks good!

    ACK except nit

  6. jonasnick force-pushed on Nov 3, 2019
  7. real-or-random commented at 8:41 am on November 4, 2019: contributor
    ACK 8de439261a34faca17e513c0b554fa5526d22e1e I read the code and I checked that it does not break the tests
  8. real-or-random commented at 2:31 pm on November 4, 2019: contributor
    Actually this would not fix the Fedora example in #645 because we still don’t output the seed to stderr in case of failure. Maybe it’s better to make make check cat the log files to stderr in case of failure.
  9. jonasnick commented at 10:25 pm on November 4, 2019: contributor

    Good point, but I’m tempted to blame this on the user. With automake you could run make check with VERBOSE=1 which will print the stdout and stderr of a failed test to stdout. So not capturing stdout seems to be not a good idea when you need diagnostics anyway. Setting VERBOSE=1 should be possible in a build system and is probably useful for other automake based packages too.

    If I understand correctly what you’re asking for is to define a custom test runner for which my automake skills are insufficient. And it could be argued that such a non-standard customization isn’t particularly helpful in the long run.

  10. real-or-random commented at 0:16 am on November 5, 2019: contributor
    Agreed, we don’t want to fiddle around with automake if this can’t be done easily.
  11. real-or-random commented at 12:34 pm on November 5, 2019: contributor
    needs rebase
  12. jonasnick force-pushed on Nov 5, 2019
  13. jonasnick commented at 1:19 pm on November 5, 2019: contributor
    rebased
  14. real-or-random approved
  15. real-or-random commented at 10:51 pm on November 5, 2019: contributor
    ACK 40458d2aeedf4ad424a97ab14c71c2f4d48c1532 I read the code and I checked that it does not break the tests
  16. gmaxwell commented at 0:49 am on November 7, 2019: contributor
    Very nice change. Might it makes sense to also unbuffer stderr?
  17. real-or-random commented at 9:48 am on November 7, 2019: contributor

    Very nice change. Might it makes sense to also unbuffer stderr?

    It is probably unbuffered on most systems (https://stackoverflow.com/a/3746795) but yep, it won’t hurt and it’s good for consistency.

  18. Make travis show the ./tests seed by removing stdout buffering and always cat tests.log after a travis run. fb424fbba2
  19. Explicitly disable buffering for stderr in tests a0771d15e6
  20. jonasnick force-pushed on Nov 25, 2019
  21. jonasnick commented at 10:23 am on November 25, 2019: contributor
    rebased and added commit to disable buffering for stderr as well
  22. real-or-random commented at 10:47 am on November 25, 2019: contributor
    ACK a0771d15e67d3fe6ac1791f81d9731f73c550e5e I looked at the diff and checked that it does not break the tests
  23. real-or-random referenced this in commit 0db61d25c9 on Nov 25, 2019
  24. real-or-random merged this on Nov 25, 2019
  25. real-or-random closed this on Nov 25, 2019

  26. deadalnix referenced this in commit ad817c9d51 on Mar 6, 2020
  27. deadalnix referenced this in commit d2a493523a on Mar 7, 2020
  28. sickpig referenced this in commit 4919da7474 on Mar 24, 2020
  29. sickpig referenced this in commit edf107e6d1 on Mar 24, 2020
  30. sickpig referenced this in commit be146ff985 on Mar 25, 2020
  31. sickpig referenced this in commit 69fed501da on Mar 25, 2020
  32. sipa cross-referenced this on Jun 9, 2020 from issue Update libsecp256k1 subtree by sipa
  33. fanquake referenced this in commit 8c97780db8 on Jun 13, 2020
  34. sidhujag referenced this in commit 8a3a072968 on Jun 13, 2020
  35. ComputerCraftr referenced this in commit b98f1c6e6c on Jun 16, 2020
  36. UdjinM6 referenced this in commit 9d36ba6570 on Aug 10, 2021
  37. 5tefan referenced this in commit 8ded2caa74 on Aug 12, 2021
  38. gades referenced this in commit d855cc511d on May 8, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/secp256k1. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-23 09:15 UTC

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