Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests sometimes time out at the very beginning #60

Closed
szmarczak opened this issue Jan 28, 2021 · 7 comments
Closed

Tests sometimes time out at the very beginning #60

szmarczak opened this issue Jan 28, 2021 · 7 comments
Labels
bug Something isn't working

Comments

@szmarczak
Copy link
Owner

Commit: 0eb1f3f

Logs:

szm@solus ~/Desktop/http2-wrapper $ ava test/agent.js -v -s

(node:18356) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
(Use `node --trace-warnings ...` to show where the warning was created)
  
  ✖ Timed out while running tests

  54 tests were pending in test/agent.js

  ◌ caches a TLS session when successfully connected
  ◌ reuses a TLS session
  ◌ purges the TLS session cache on session error
  ◌ getSession() - passing string as `origin`
  ◌ getSession() - passing URL as `origin`
  ◌ `timeout` option
  ◌ `timeout` option - endless response
  ◌ `.settings` property
  ◌ `session` event
  ◌ `protocol` property
  ◌ `.sessions` may contain destroyed sessions
  ◌ `.sessions` may contain closed sessions
  ◌ sessions are grouped into options and authorities`
  ◌ prevents session overloading #1
  ◌ prevents session overloading #2
  ◌ prevents session overloading #3
  ◌ sessions can be manually overloaded
  ◌ respects the `maxSessions` option
  ◌ creates new session if there are no free sessions
  ◌ free sessions can become suddenly covered by shrinking their current streams count
  ◌ busy sessions can become suddenly covered by shrinking their current streams count
  ◌ session can cover another session by increasing its streams count limit
  ◌ closes covered sessions - `origin` event
  ◌ closes covered sessions - session no longer busy
  ◌ graceful close works
  ◌ does not close covered sessions if the current one is full
  ◌ no negative session count
  ◌ properly calculates session count #1
  ◌ properly calculates session count #2
  ◌ properly calculates session count #3
  ◌ properly calculates session count #4
  ◌ uses sessions which are more loaded to use fewer connections
  ◌ sessions are picked in an optimal way #1
  ◌ sessions are picked in an optimal way #2
  ◌ picks sessions with the highest stream capacity (single origin)
  ◌ picks sessions with the highest stream capacity (many origins)
  ◌ does not create a new session if there exists an authoritive one
  ◌ session may become free on maxConcurrentStreams update
  ◌ gives free sessions if available
  ◌ throws on servername mismatch
  ◌ throws if session is closed before receiving a SETTINGS frame
  ◌ newly queued sessions should not throw after `agent.destroy()`
  ◌ errors on failure
  ◌ catches session.request() errors
  ◌ no infinity loop on endpoint mismatch
  ◌ `.closeEmptySessions()` works
  ◌ respects `.maxEmptySessions` changes
  ◌ closes empty sessions automatically
  ◌ `maxEmptySessions` set to 0 causes to close the session after running through the queue
  ◌ gives the queued session if exists
  ◌ processes session queue on session close
  ◌ `agent.destroy()` destroys free sessions
  ◌ `agent.destroy()` destroys busy sessions
  ◌ `agent.destroy()` makes pending sessions throw
@szmarczak szmarczak added the bug Something isn't working label Jan 28, 2021
@szmarczak
Copy link
Owner Author

I think it has something to do with session creation because even benchmarks are affected:

szm@solus ~/Desktop/http2-wrapper $ 0x benchmark.js 
🔥  Profiling(node:28089) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
(Use `node --trace-warnings ...` to show where the warning was created)
http2-wrapper - preconfigured session x 16.78 ops/sec ±195.55% (73 runs sampled)
Fastest is http2-wrapper - preconfigured session
🔥  Flamegraph generated in
file:///home/szm/Desktop/http2-wrapper/28089.0x/flamegraph.html

szm@solus ~/Desktop/http2-wrapper $ 0x benchmark.js 
🔥  Profiling(node:28182) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
(Use `node --trace-warnings ...` to show where the warning was created)
http2-wrapper - preconfigured session x 7,671 ops/sec ±8.64% (72 runs sampled)
Fastest is http2-wrapper - preconfigured session
🔥  Flamegraph generated in
file:///home/szm/Desktop/http2-wrapper/28182.0x/flamegraph.html

@szmarczak
Copy link
Owner Author

Also something has changed in the Node.js core because the benchmarks show 7k instead of 12k and the native http2 is now 13k instead of 18k.

@szmarczak
Copy link
Owner Author

Even previous commits are impacted...

@szmarczak
Copy link
Owner Author

Still reproducible on v15.5.1. Trying lower versions...

@szmarczak
Copy link
Owner Author

szmarczak commented Jan 28, 2021

Still reproducible on v15.4.0 v15.3.0 v15.2.1 v15.1.0 v15.0.1 v14.15.4 v14.14.0 v14.0.0 v13.14.0 v12.20.1

@szmarczak
Copy link
Owner Author

This is going too far. Either my Linux distro messed up or dunno. I noticed that quite often songs on native Spotify (on Solus distro) go quite for a few seconds. Will have to debug tomorrow. Going to sleep now.

@szmarczak
Copy link
Owner Author

Definitely my distro messed up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant