Distributive-Network/PythonMonkey

Local test failure: xhr-http-keep-alive.bash

philippedistributive opened this issue · 4 comments

Issue type

Bug

How did you install PythonMonkey?

None

OS platform and distribution

No response

Python version (python --version)

No response

PythonMonkey version (pip show pythonmonkey)

No response

Bug Description

poetry run bash ./peter-jr ./tests/js/

get each time:

Testing tests/js/xhr-http-keep-alive.bash ... FAIL

-- tests/js/xhr-http-keep-alive.bash vvvvvvvvvvvvvv
strace: Process 62014 attached
[pid 62014] +++ exited with 0 +++
strace: Process 62015 attached
strace: Process 62016 attached
strace: Process 62017 attached
strace: Process 62018 attached
strace: Process 62019 attached
strace: Process 62020 attached
strace: Process 62021 attached
strace: Process 62022 attached
strace: Process 62023 attached
[pid 62023] socket(AF_NETLINK, SOCK_RAW|SOCK_CLOEXEC, NETLINK_ROUTE) = 6
[pid 62023] socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 7
[pid 62023] socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 6
[pid 62023] socket(AF_INET, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, IPPROTO_IP) = 6
[pid 62023] socket(AF_INET, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, IPPROTO_IP) = 6
Future exception was never retrieved
future:
pythonmonkey.SpiderMonkeyError: {}
strace: Process 62024 attached
[pid 62023] +++ exited with 0 +++
[pid 62024] +++ exited with 0 +++
[pid 62018] +++ exited with 0 +++
[pid 62015] +++ exited with 0 +++
[pid 62020] +++ exited with 0 +++
[pid 62017] +++ exited with 0 +++
[pid 62019] +++ exited with 0 +++
[pid 62016] +++ exited with 0 +++
[pid 62022] +++ exited with 0 +++
[pid 62021] +++ exited with 0 +++
+++ exited with 0 +++
TCP connections opened: 0
FAIL: qty should not be 0
-- tests/js/xhr-http-keep-alive.bash ^^^^^^^^^^^^^^

Standalone code to reproduce the issue

No response

Relevant log output or backtrace

No response

Additional info if applicable

No response

What branch of PythonMonkey were you developing on? (If applicable)

No response

@philippedistributive
Definitely it errors, but not showing the Error stacks etc..

Could you put the contents of

function newRequest(url) {
return new Promise(function (resolve, reject)
{
let xhr = new XMLHttpRequest();
xhr.open("GET", url);
xhr.onload = function ()
{
if (this.status >= 200 && this.status < 300) resolve(this.response);
else reject(new Error(this.status));
};
xhr.onerror = (ev) => reject(ev.error);
xhr.send();
});
}
async function main() {
await newRequest("http://www.example.org/");
await newRequest("http://www.example.org/");
await newRequest("http://http.badssl.com/");
}
main();
into a js file, and run it with strace -f -e socket pmjs xxx.js?
What's the output?

strace -f -e socket poetry run pmjs xxx.js
socket(AF_INET6, SOCK_STREAM|SOCK_CLOEXEC, IPPROTO_IP) = 3
strace: Process 65501 attached
[pid 65501] +++ exited with 0 +++
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=65501, si_uid=1001, si_status=0, si_utime=1 /* 0.01 s /, si_stime=1 / 0.01 s /} ---
strace: Process 65502 attached
[pid 65502] +++ exited with 0 +++
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=65502, si_uid=1001, si_status=0, si_utime=2 /
0.02 s /, si_stime=0} ---
strace: Process 65503 attached
[pid 65503] +++ exited with 0 +++
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=65503, si_uid=1001, si_status=0, si_utime=2 /
0.02 s */, si_stime=0} ---
strace: Process 65504 attached
[pid 65504] +++ exited with 0 +++
strace: Process 65505 attached
strace: Process 65506 attached
strace: Process 65507 attached
strace: Process 65508 attached
strace: Process 65509 attached
strace: Process 65510 attached
strace: Process 65511 attached
strace: Process 65512 attached
strace: Process 65513 attached
[pid 65513] socket(AF_NETLINK, SOCK_RAW|SOCK_CLOEXEC, NETLINK_ROUTE) = 6
[pid 65513] socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 7
[pid 65513] socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 6
[pid 65513] socket(AF_INET, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, IPPROTO_IP) = 6
[pid 65513] socket(AF_INET, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, IPPROTO_IP) = 6
Uncaught NetworkError: Error: Python ClientConnectorError: Cannot connect to host www.example.org:80 ssl:default [Name or service not known]
DOMException@/home/philippe/Sources/PythonMonkey/python/pminit/pythonmonkey/node_modules/core-js/modules/web.dom-exception.constructor.js:64:17
#handleErrors@/home/philippe/Sources/PythonMonkey/python/pythonmonkey/builtin_modules/XMLHttpRequest.js:423:48
_home_philippe_Sources_PythonMonkey_python_pythonmonkey_builtin_modules_XMLHttpRequest_js/#sendAsync/<@/home/philippe/Sources/PythonMonkey/python/pythonmonkey/builtin_modules/XMLHttpRequest.js:400:38
strace: Process 65514 attached
[pid 65513] +++ exited with 0 +++
[pid 65514] +++ exited with 0 +++
[pid 65510] +++ exited with 0 +++
[pid 65511] +++ exited with 0 +++
[pid 65512] +++ exited with 0 +++
[pid 65509] +++ exited with 0 +++
[pid 65508] +++ exited with 0 +++
[pid 65507] +++ exited with 0 +++
[pid 65505] +++ exited with 0 +++
[pid 65506] +++ exited with 0 +++
+++ exited with 0 +++

Uncaught NetworkError: Error: Python ClientConnectorError: Cannot connect to host [www.example.org:80](http://www.example.org/) ssl:default [Name or service not known]

Check your DNS

um, yeah ok...