eunit: Pass node name to {node, ...} instantiator#10788
eunit: Pass node name to {node, ...} instantiator#10788williamthome wants to merge 1 commit intoerlang:maintfrom
Conversation
CT Test Results 2 files 12 suites 3m 18s ⏱️ Results for commit e02aa5c. ♻️ This comment has been updated with latest results. To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass. See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally. Artifacts
// Erlang/OTP Github Action Bot |
4932e8a to
cf74268
Compare
|
Looks good to me. I checked it with the following: |
|
Is automatic enabling of net_kernel safe now? It was disabled on 27 as well. |
Hmm I'm unsure. Where/when was it disabled in OTP 27? I've been trying to locate the specific change but haven't found it. Or do you mean the comments that already exist removed by this PR? Note the auto-start is intentionally limited to EUnit's Do you recommend removing the auto-start? |
lib/eunit/src/eunit_data.erl
Outdated
| 'nonode@nohost' -> | ||
| M = list_to_atom(atom_to_list(Name) | ||
| ++ "_eunit_master"), | ||
| case net_kernel:start([M, shortnames]) of |
There was a problem hiding this comment.
Given that net_kernel:start/1 is deprecated -- per https://www.erlang.org/doc/apps/kernel/net_kernel.html#start/1 -- should this use net_kernel:start/2 instead?
There was a problem hiding this comment.
Yes, looks like you're right
I meant the comment you removed, which is present on maint-27 branch as well. I don't know yet, will have to dig into the code and test if it's ok to do that. |
c00fbcc to
423ef55
Compare
Yes, I tested it during system initialization using all init flags ( |
|
Since this can be considered a bug, could you rebase your branch from patch-base-28 tag, so we can apply it to older branches? We will run this in our CI and see if there are any problems with this automatic start of net_kernel. |
|
You're right, it doesn't exist, my bad. You can rebase from tag |
The migration from slave to peer in OTP-28 discarded the node
name returned by peer:start_link/1, passing the Pid to the
instantiator instead of the node name. This made {node, ...}
unusable since the instantiator needs the node name to use
with {spawn, Node, Tests} or erpc:call/4.
Capture the node name and wrap the instantiator so it receives
the node name as an atom. Restore auto-start of net_kernel
for non-distributed nodes so {node, ...} works out of the box.
423ef55 to
e02aa5c
Compare
Done. |

The migration from slave to peer in OTP-28 discarded the node name returned by peer:start_link/1, passing the Pid to the instantiator instead of the node name. This made {node, ...} unusable since the instantiator needs the node name to use with {spawn, Node, Tests} or erpc:call/4.
Capture the node name and wrap the instantiator so it receives the node name as an atom. Restore auto-start of net_kernel for non-distributed nodes so {node, ...} works out of the box.