qa: Remove race between connecting and shutdown on separate connections #14958

pull promag wants to merge 1 commits into bitcoin:master from promag:2018-12-improve-shutdown-test changing 1 files +8 −2
  1. promag commented at 12:01 pm on December 14, 2018: member

    Fixes the error #14670 (comment) reported by @ken2812221.

    There is a race between RPC stop and another concurrent call in the test framework. The connection must be established and the command waitfornewblock running before calling stop.

    See also #14670 (comment).

  2. promag force-pushed on Dec 14, 2018
  3. fanquake added the label Tests on Dec 14, 2018
  4. promag force-pushed on Dec 14, 2018
  5. in test/functional/feature_shutdown.py:28 in e2b0fecce3 outdated
    21@@ -20,7 +22,10 @@ def set_test_params(self):
    22 
    23     def run_test(self):
    24         node = get_rpc_proxy(self.nodes[0].url, 1, timeout=600, coveragedir=self.nodes[0].coverage_dir)
    25+        # force connection establishment
    26+        node.getblockcount()
    27         Thread(target=test_long_call, args=(node,)).start()
    28+        sleep(1)
    


    laanwj commented at 12:08 pm on December 14, 2018:
    I don’t like hardcoding a second of sleep here, hardly seems robust.

    promag commented at 12:53 pm on December 14, 2018:

    Agree, this should be replaced by something like:

    0wait_until(lambda: self.getrpcinfo()['active_workers'] > 1)
    

    Other suggestions?

  6. promag force-pushed on Dec 14, 2018
  7. promag force-pushed on Dec 14, 2018
  8. in src/rpc/server.cpp:34 in eeb8e043f8 outdated
    30@@ -31,12 +31,12 @@ static std::string rpcWarmupStatus GUARDED_BY(cs_rpcWarmup) = "RPC server starte
    31 static RPCTimerInterface* timerInterface = nullptr;
    32 /* Map of name to timer. */
    33 static std::map<std::string, std::unique_ptr<RPCTimerBase> > deadlineTimers;
    34+static std::shared_ptr<int> g_active_commands_counter = std::make_shared<int>(0);
    


    promag commented at 5:01 pm on December 14, 2018:
    Consider this approach temporary, just for concept ack.
  9. promag force-pushed on Jan 2, 2019
  10. laanwj referenced this in commit cf0c67b62c on Jan 14, 2019
  11. promag force-pushed on Jan 15, 2019
  12. in test/functional/feature_shutdown.py:24 in 49a79d4542 outdated
    19@@ -20,8 +20,14 @@ def set_test_params(self):
    20 
    21     def run_test(self):
    22         node = get_rpc_proxy(self.nodes[0].url, 1, timeout=600, coveragedir=self.nodes[0].coverage_dir)
    23+        # Force connection establishment by executing a dummy command.
    24+        node.getblockcount()
    


    MarcoFalke commented at 5:11 pm on January 15, 2019:
    Is this required given that we wait anyway until node.waitfornewblock is called, which in turn should set up the connection?

    promag commented at 5:30 pm on January 15, 2019:
    For the test to pass this is not required, but this is here to note that there’s still a race after connection establishment. Let me know if it’s not important.
  13. MarcoFalke commented at 5:55 pm on January 15, 2019: member
    utACK 49a79d454284df7758f83ccd3121afb3e6799342
  14. promag renamed this:
    qa: Remove race between conneting and shutdown on separate connections
    qa: Remove race between connecting and shutdown on separate connections
    on Jan 16, 2019
  15. qa: Remove race between connecting and shutdown on separate connections 4412a59bfe
  16. promag force-pushed on Jan 16, 2019
  17. laanwj commented at 12:05 pm on January 16, 2019: member
    utACK 4412a59bfe8228698e5b5bbe8bb21c8e8a70d357 No difference with 49a79d4 except for commit msg.
  18. laanwj merged this on Jan 16, 2019
  19. laanwj closed this on Jan 16, 2019

  20. laanwj referenced this in commit 3ae3748ce1 on Jan 16, 2019
  21. promag deleted the branch on Jan 16, 2019
  22. scravy referenced this in commit 6753dac00f on Feb 28, 2019
  23. PastaPastaPasta referenced this in commit f8bbe7a8c2 on Jun 26, 2021
  24. PastaPastaPasta referenced this in commit aa199d882d on Jun 27, 2021
  25. PastaPastaPasta referenced this in commit 6d6c12b81c on Jun 28, 2021
  26. PastaPastaPasta referenced this in commit 77fc7bd31c on Jun 29, 2021
  27. PastaPastaPasta referenced this in commit b67f5124cc on Jul 1, 2021
  28. PastaPastaPasta referenced this in commit 399514859c on Jul 1, 2021
  29. pravblockc referenced this in commit 4f3dbaad66 on Aug 10, 2021
  30. pravblockc referenced this in commit af3419c931 on Aug 10, 2021
  31. pravblockc referenced this in commit 724eecb675 on Aug 14, 2021
  32. vijaydasmp referenced this in commit 5a0697d879 on Sep 12, 2021
  33. vijaydasmp referenced this in commit 4ead82808c on Sep 12, 2021
  34. vijaydasmp referenced this in commit 20f3ca9350 on Sep 12, 2021
  35. vijaydasmp referenced this in commit 685f93feeb on Sep 12, 2021
  36. vijaydasmp referenced this in commit 0d9f0a0ec9 on Sep 12, 2021
  37. vijaydasmp referenced this in commit 63963b773b on Sep 13, 2021
  38. vijaydasmp referenced this in commit a1eec87f3f on Sep 13, 2021
  39. DrahtBot locked this on Dec 16, 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: 2024-12-23 00:13 UTC

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