<p>I am working on a PR to migrate all test-only rpcs under the <code>-test</code> rpc . I am facing an issue where in one of the functional test <code>feature_config_args.py</code> , the node is not creating a debug log . Here is the <code>test_framework.log</code>.</p>
<pre><code>2024-08-26T15:07:46.488000Z TestFramework (ERROR): Unexpected exception caught during testing
Traceback (most recent call last):
  File &quot;/home/probot/bitcoin/test/functional/test_framework/test_framework.py&quot;, line 132, in main
    self.run_test()
  File &quot;/home/probot/bitcoin/test/functional/feature_config_args.py&quot;, line 429, in run_test
    self.test_testnet3_deprecation_msg()
  File &quot;/home/probot/bitcoin/test/functional/feature_config_args.py&quot;, line 393, in test_testnet3_deprecation_msg
    with open(f&quot;{log_dir}/debug.log&quot;, 'w'), self.nodes[0].assert_debug_log([t3_warning_log]):
  File &quot;/home/probot/.pyenv/versions/3.10.8/lib/python3.10/contextlib.py&quot;, line 135, in __enter__
    return next(self.gen)
  File &quot;/home/probot/bitcoin/test/functional/test_framework/test_node.py&quot;, line 485, in assert_debug_log
    prev_size = self.debug_log_size(encoding=&quot;utf-8&quot;)  # Must use same encoding that is used to read() below
  File &quot;/home/probot/bitcoin/test/functional/test_framework/test_node.py&quot;, line 473, in debug_log_size
    with open(self.debug_log_path, **kwargs) as dl:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/test_runner_₿__20240826_203720/feature_config_args_0/node0/testnet3/debug.log'
2024-08-26T15:07:46.540000Z TestFramework (INFO): Stopping nodes
</code></pre>
<p>You can look at the PR here <a href="https://github.com/bitcoin/bitcoin/compare/master...Prabhat1308:bitcoin:test/make_changes" rel="nofollow noreferrer">PR</a></p>
<p>The failing test is unrelated to the changes made in the file and I can't seem to figure out why the debug.log is not being created.</p>

CC BY-SA 4.0
2024-08-26T15:39:20.907Z
I do not know why the debug.log is not being produced, but how did you get the idea for this refactor? I was a bit surprised that you are working on this. Is there an open issue for this, or did someone suggest this work? If not, you might want to bring it up in the Bitcoin Core developer IRC channel to substantiate that this is something that would be considered for merging. Some of the RPCs you are moving to "test-only" are definitely used in production, e.g. `stopatheight`, `deprecatedrpc`.
Murch
CC BY-SA 4.0
2024-08-26T15:46:37.490Z
@Murch . You can look at the PR description I was about to create here https://hackmd.io/@Prabhat1308/By0A4paP0/edit . This PR was something I was suggested by stratospher  to work on , however I had to choose the rpcs on my own , I asked about it here but never got the answer to the question . Link to the question here  
 https://bitcoin.stackexchange.com/questions/123659/identifying-test-only-rpc-arguments .
Prabhat Verma
CC BY-SA 4.0
2024-08-26T17:53:05.060Z
Maybe I’m confused, but the discussion on #29007 seems to mention that some RPC parameters should be moved to a "test-only" subgroup, but your PR seems to touch a bunch of startup options. Either way, if your PR is basically ready to be opened on the Bitcoin repository, how about you open it, and we discuss there?
Murch
CC BY-SA 4.0
2024-08-26T17:55:39.980Z
@Murch For sure. I have found a workaround for this debug problem for now and shipped the code . Here is the link https://github.com/bitcoin/bitcoin/pull/30717.
Prabhat Verma
<bitcoin-core><bitcoin-core-development><testing><functional-test>
Failing to create a debug log in functional test
Prabhat Verma
# Failing to create a debug log in functional test

(Asked by: username_0 on 2024-08-26)

I am working on a PR to migrate all test-only rpcs under the `-test` rpc . I am facing an issue where in one of the functional test `feature_config_args.py` , the node is not creating a debug log . Here is the `test_framework.log`.

```
2024-08-26T15:07:46.488000Z TestFramework (ERROR): Unexpected exception caught during testing
Traceback (most recent call last):
  File "/home/probot/bitcoin/test/functional/test_framework/test_framework.py", line 132, in main
    self.run_test()
  File "/home/probot/bitcoin/test/functional/feature_config_args.py", line 429, in run_test
    self.test_testnet3_deprecation_msg()
  File "/home/probot/bitcoin/test/functional/feature_config_args.py", line 393, in test_testnet3_deprecation_msg
    with open(f"{log_dir}/debug.log", 'w'), self.nodes[0].assert_debug_log([t3_warning_log]):
  File "/home/probot/.pyenv/versions/3.10.8/lib/python3.10/contextlib.py", line 135, in __enter__
    return next(self.gen)
  File "/home/probot/bitcoin/test/functional/test_framework/test_node.py", line 485, in assert_debug_log
    prev_size = self.debug_log_size(encoding="utf-8")  # Must use same encoding that is used to read() below
  File "/home/probot/bitcoin/test/functional/test_framework/test_node.py", line 473, in debug_log_size
    with open(self.debug_log_path, **kwargs) as dl:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/test_runner_₿__20240826_203720/feature_config_args_0/node0/testnet3/debug.log'
2024-08-26T15:07:46.540000Z TestFramework (INFO): Stopping nodes

```

You can look at the PR here [PR](https://github.com/bitcoin/bitcoin/compare/master...Prabhat1308:bitcoin:test/make_changes)

The failing test is unrelated to the changes made in the file and I can't seem to figure out why the debug.log is not being created.

**Tags:** bitcoin-core, bitcoin-core-development, testing, functional-test

> **Comments:**
> **username_1**: I do not know why the debug.log is not being produced, but how did you get the idea for this refactor? I was a bit surprised that you are working on this. Is there an open issue for this, or did someone suggest this work? If not, you might want to bring it up in the Bitcoin Core developer IRC channel to substantiate that this is something that would be considered for merging. Some of the RPCs you are moving to "test-only" are definitely used in production, e.g. `stopatheight`, `deprecatedrpc`.  
> **username_0**: @username_1 . You can look at the PR description I was about to create here https://hackmd.io/@Prabhat1308/By0A4paP0/edit . This PR was something I was suggested by stratospher  to work on , however I had to choose the rpcs on my own , I asked about it here but never got the answer to the question . Link to the question here    https://bitcoin.stackexchange.com/questions/123659/identifying-test-only-rpc-arguments .  
> **username_1**: Maybe I’m confused, but the discussion on #29007 seems to mention that some RPC parameters should be moved to a "test-only" subgroup, but your PR seems to touch a bunch of startup options. Either way, if your PR is basically ready to be opened on the Bitcoin repository, how about you open it, and we discuss there?  
> **username_0**: @username_1 For sure. I have found a workaround for this debug problem for now and shipped the code . Here is the link https://github.com/bitcoin/bitcoin/pull/30717.  

---

## 0 answers

