test: don't try and use os.killpg() on Windows #22936

pull fanquake wants to merge 1 commits into bitcoin:master from fanquake:windows_no_killpg changing 1 files +3 −1
  1. fanquake commented at 5:18 AM on September 10, 2021: member

    os.killpg and os.getpgid are Unix only. Seen in at least #20744:

    Runtime: 1 s
    
    Traceback (most recent call last):
      File "C:\Users\ContainerAdministrator\AppData\Local\Temp\cirrus-ci-build\test\functional\test_runner.py", line 797, in <module>
        main()
      File "C:\Users\ContainerAdministrator\AppData\Local\Temp\cirrus-ci-build\test\functional\test_runner.py", line 446, in main
        run_tests(
      File "C:\Users\ContainerAdministrator\AppData\Local\Temp\cirrus-ci-build\test\functional\test_runner.py", line 567, in run_tests
        os.killpg(os.getpgid(0), signal.SIGKILL)
    AttributeError: module 'os' has no attribute 'killpg'
    
    C:\Users\ContainerAdministrator\AppData\Local\Temp\cirrus-ci-build>if 1 NEQ 0 exit /b 1 
    
  2. test: don't try and use os.killpg() on Windows
    os.killpg and os.getpgid are Unix only.
    
    https://docs.python.org/3.6/library/os.html#os.killpg
    91ebb799dc
  3. fanquake added the label Tests on Sep 10, 2021
  4. hebasto commented at 7:45 AM on September 10, 2021: member

    Just curious, why do functional tests pass in the current master (after #22922)?

    UPDATE: nm, I see the reason.

  5. hebasto commented at 7:52 AM on September 10, 2021: member

    Related: #22249#pullrequestreview-683640698

  6. MarcoFalke approved
  7. MarcoFalke commented at 8:07 AM on September 10, 2021: member

    An alternative would be to just not fix it. I mean who uses Windows anyway (to run the functional tests with --failfast).

    At least with the error message, it well be clear that something went wrong. With this patch it will leave them dangling.

  8. S3RK commented at 8:27 PM on September 10, 2021: contributor

    @fanquake I'm not familiar with how windows processes work. So what's the behaviour with this patch?

    Will the tests continue to run and exit normally? Will the tests be killed by OS after the test runner finished? Or something else entirely?

  9. laanwj commented at 2:40 PM on September 16, 2021: member

    I'm not familiar with how windows processes work. So what's the behaviour with this patch?

    killpg sends a signal to a whole process group. windows doesnt have the concept of process groups, to do a similar thing i think you'd have to manually iterate the process tree

  10. fanquake commented at 3:05 AM on September 17, 2021: member

    We can just leave this for now.

  11. fanquake closed this on Sep 17, 2021

  12. ryanofsky commented at 5:12 AM on September 21, 2021: contributor

    How should I handle a PR that seems to be failing CI because of this? Restart the job? Ignore it? Is this a race condition? I didn't read through all the related issues but I can't figure out from discussion above what seems to make this problem happen only sometimes or how to handle it. The failure is https://github.com/bitcoin/bitcoin/pull/22937/checks?check_run_id=3646048735 in #22937.

  13. MarcoFalke commented at 6:46 AM on September 21, 2021: member

    The error from https://cirrus-ci.com/task/4664491330764800?logs=functional_tests#L148 is

     node0 stderr Error: Specified data directory "C:\Users\ContainerAdministrator\AppData\Local\Temp\test_runner_₿_🏃_20210910_034136\rpc_help_4\node0" does not exist. 
    
  14. MarcoFalke commented at 6:49 AM on September 21, 2021: member

    The error from https://cirrus-ci.com/task/5711752030584832?logs=functional_tests#L0 is

    OSError: [WinError 10048] Only one usage of each socket address (protocol/network address/port) is normally permitted
    

    (You need to download the full log to see it)

  15. katesalazar commented at 8:20 PM on October 13, 2021: contributor

    I mean who uses Windows anyway (to run the functional tests with --failfast).

    That looks like a perfectly valid use case. I think #23085 is a legit issue.

    Of course that doesn't mean that any "non Windows heads" at all should pay much attention at it, unless for whatever reason wanting to.

    Cheers!

  16. jamesob commented at 2:28 AM on October 21, 2021: member

    I think this is worth merging if it would clarify underlying failures, e.g. in https://github.com/bitcoin/bitcoin/pull/23289/checks?check_run_id=3955413522 the presence of this error seems to be obscuring the actual issue (https://github.com/bitcoin/bitcoin/pull/23303).

  17. MarcoFalke commented at 7:11 AM on October 21, 2021: member

    It might be better to introduce a new option --fail-fast-dangling to clarify that this fails fast, but leaves everything dangling.

    (Or an undocumented ENV var, if the overhead of a new option would be too much)

  18. katesalazar commented at 8:29 PM on October 23, 2021: contributor

    an undocumented ENV var

    that's great, simple, clean, traditional, and produces code easy to read

  19. bitcoin locked this on Oct 30, 2022
  20. fanquake deleted the branch on Sep 14, 2023

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-24 21:14 UTC

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