test: remove magic numbers in test-gc-http-client-onerror
Remove magic numbers 500 and 10 from the test. Instead, detect when GC has started and stop sending requests at that point.
On my laptop, this results in 68 or 72 requests per run instead of 500.
Fixes: https://github.com/nodejs/node/issues/23089
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows commit guidelines