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

Draft: add ping testplan for JS (browser) #74

Closed
wants to merge 13 commits into from

Conversation

GlenDC
Copy link
Contributor

@GlenDC GlenDC commented Nov 13, 2022

⚠️ Work is halted!!!! PAUSED

@MarcoPolo is working on #97, which means that we might not use testground at all for the cross-platform ping tests.
As such I am for now cancelling this work and keeping it as is. What is done and is to be done can be seen below.

Description

  • Implement the libp2p ping test using node.js, with just two nodes that can communicate with each other.
    • Had to adapt for being able to debug better sdk-js, PR for that is open: minor sdk-js fix: print stack trace for unexpected plan crashes testground/sdk-js#29
    • The tests work between two Node Libp2p nodes (see README included as part of this PR) (Yay!!!)
    • TODO:
      • finish the test, further basing myself on the Go / Nim tests
      • improve the code, making it more node-agnostic and other improvements
      • test browser version, just to estimate the work
      • if possible and not too much work we might as well already document how to test between two chromium nodes
  • Add the test to the composer, using @Tanguy (nim-libp2p)'s recent merge as a guide. This will still be a single node.js version added to the test (https://github.com/libp2p/test-plans/pull/70/files)
  • Expand the configuration to include browser testing.
  • Tackle the challenge of dealing with many versions. (out of scope for this PR, will be tackled in a future PR);

Base code copied from offical browser-node testground example.

In function of #61 and #53

- does not work yet
- we are however setting up towards something that will work eventually
@GlenDC
Copy link
Contributor Author

GlenDC commented Jan 7, 2023

⚠️ Work is halted!!!! PAUSED

@MarcoPolo is working on #97,
which means that we might not use testground at all for the cross-platform ping tests.

As such I am for now cancelling this work and keeping it as is. What is done and is to be done can be seen below.

@GlenDC
Copy link
Contributor Author

GlenDC commented Jan 7, 2023

⚠️ Work is halted!!!! PAUSED

@MarcoPolo is working on #97, which means that we might not use testground at all for the cross-platform ping tests.

As such I am for now cancelling this work and keeping it as is. What is done and is to be done can be seen below.

NodeJS-to-NodeJS works in a basic manner:

Jan  7 21:12:31.661680  INFO    1.1388s      OTHER << single[001] (42a153) >> 
Jan  7 21:12:31.661781  INFO    1.1389s      OTHER << single[001] (42a153) >> > [email protected] start
Jan  7 21:12:31.661826  INFO    1.1389s      OTHER << single[001] (42a153) >> > node runtime/index.js
Jan  7 21:12:31.661862  INFO    1.1390s      OTHER << single[001] (42a153) >> 
Jan  7 21:12:31.691113  INFO    1.1682s      OTHER << single[000] (eff829) >> 
Jan  7 21:12:31.691207  INFO    1.1683s      OTHER << single[000] (eff829) >> > [email protected] start
Jan  7 21:12:31.691276  INFO    1.1684s      OTHER << single[000] (eff829) >> > node runtime/index.js
Jan  7 21:12:31.691316  INFO    1.1684s      OTHER << single[000] (eff829) >> 
Jan  7 21:12:33.334350  INFO    2.8091s      START << single[001] (42a153) >> {"plan":"compatibility-js","case":"ping","run":"cestviu0dpen93vs10og","outputs_path":"/outputs","instances":2,"group":"single","group_instances":2,"network":"16.3.0.0/16","start_time":"0001-01-01T00:00:00Z"}
Jan  7 21:12:33.340015  INFO    2.8161s    MESSAGE << single[001] (42a153) >> started test instance; params: max_latency_ms=1000, iterations=5
Jan  7 21:12:33.340925  INFO    2.8161s    MESSAGE << single[001] (42a153) >> waiting for network initialization
Jan  7 21:12:33.345927  INFO    2.8221s    MESSAGE << single[001] (42a153) >> network initialisation successful
Jan  7 21:12:33.346809  INFO    2.8221s    MESSAGE << single[001] (42a153) >> network initilization complete
Jan  7 21:12:33.347770  INFO    2.8231s    MESSAGE << single[001] (42a153) >> 127.0.0.1 not in data subnet 16.3.0.0/16
Jan  7 21:12:33.348318  INFO    2.8241s    MESSAGE << single[001] (42a153) >> 192.18.0.13 not in data subnet 16.3.0.0/16
Jan  7 21:12:33.348848  INFO    2.8251s    MESSAGE << single[001] (42a153) >> detected data network IP: 16.3.0.2
Jan  7 21:12:33.354618  INFO    2.8301s      START << single[000] (eff829) >> {"plan":"compatibility-js","case":"ping","run":"cestviu0dpen93vs10og","outputs_path":"/outputs","instances":2,"group":"single","group_instances":2,"network":"16.3.0.0/16","start_time":"0001-01-01T00:00:00Z"}
Jan  7 21:12:33.363522  INFO    2.8391s    MESSAGE << single[000] (eff829) >> started test instance; params: max_latency_ms=1000, iterations=5
Jan  7 21:12:33.364605  INFO    2.8401s    MESSAGE << single[000] (eff829) >> waiting for network initialization
Jan  7 21:12:33.378590  INFO    2.8541s    MESSAGE << single[000] (eff829) >> network initialisation successful
Jan  7 21:12:33.385010  INFO    2.8581s    MESSAGE << single[000] (eff829) >> network initilization complete
Jan  7 21:12:33.388920  INFO    2.8641s    MESSAGE << single[000] (eff829) >> 127.0.0.1 not in data subnet 16.3.0.0/16
Jan  7 21:12:33.390593  INFO    2.8651s    MESSAGE << single[000] (eff829) >> 192.18.0.14 not in data subnet 16.3.0.0/16
Jan  7 21:12:33.390675  INFO    2.8651s    MESSAGE << single[000] (eff829) >> detected data network IP: 16.3.0.3
Jan  7 21:12:33.412970  INFO    2.8881s    MESSAGE << single[001] (42a153) >> starting libp2p node
Jan  7 21:12:33.445785  INFO    2.9211s    MESSAGE << single[000] (eff829) >> starting libp2p node
Jan  7 21:12:33.494124  INFO    2.9691s    MESSAGE << single[001] (42a153) >> libp2p is listening on the following addresses: /ip4/16.3.0.2/tcp/8000/ws/p2p/12D3KooWHZsecmLWAJsQQgCfdt4a7MuhNvrQ98V9kt4tmY3wkPSe
Jan  7 21:12:33.494206  INFO    2.9701s    MESSAGE << single[001] (42a153) >> published our own (peer: 12D3KooWHZsecmLWAJsQQgCfdt4a7MuhNvrQ98V9kt4tmY3wkPSe) address: /ip4/16.3.0.2/tcp/8000/ws/p2p/12D3KooWHZsecmLWAJsQQgCfdt4a7MuhNvrQ98V9kt4tmY3wkPSe
Jan  7 21:12:33.516600  INFO    2.9921s    MESSAGE << single[000] (eff829) >> libp2p is listening on the following addresses: /ip4/16.3.0.3/tcp/8000/ws/p2p/12D3KooWQNSVMXcuLfAhaeQb7jCPBEDbCTCrwKAwnjh2ikk7MoFz
Jan  7 21:12:33.516720  INFO    2.9921s    MESSAGE << single[000] (eff829) >> published our own (peer: 12D3KooWQNSVMXcuLfAhaeQb7jCPBEDbCTCrwKAwnjh2ikk7MoFz) address: /ip4/16.3.0.3/tcp/8000/ws/p2p/12D3KooWQNSVMXcuLfAhaeQb7jCPBEDbCTCrwKAwnjh2ikk7MoFz
Jan  7 21:12:33.598416  INFO    3.0741s    MESSAGE << single[001] (42a153) >> received peer: {"addrs":["/ip4/16.3.0.2/tcp/8000/ws/p2p/12D3KooWHZsecmLWAJsQQgCfdt4a7MuhNvrQ98V9kt4tmY3wkPSe"],"id":"12D3KooWHZsecmLWAJsQQgCfdt4a7MuhNvrQ98V9kt4tmY3wkPSe"}
Jan  7 21:12:33.598416  INFO    3.0741s    MESSAGE << single[000] (eff829) >> received peer: {"addrs":["/ip4/16.3.0.2/tcp/8000/ws/p2p/12D3KooWHZsecmLWAJsQQgCfdt4a7MuhNvrQ98V9kt4tmY3wkPSe"],"id":"12D3KooWHZsecmLWAJsQQgCfdt4a7MuhNvrQ98V9kt4tmY3wkPSe"}
Jan  7 21:12:33.599786  INFO    3.0751s    MESSAGE << single[000] (eff829) >> received peer: {"addrs":["/ip4/16.3.0.3/tcp/8000/ws/p2p/12D3KooWQNSVMXcuLfAhaeQb7jCPBEDbCTCrwKAwnjh2ikk7MoFz"],"id":"12D3KooWQNSVMXcuLfAhaeQb7jCPBEDbCTCrwKAwnjh2ikk7MoFz"}
Jan  7 21:12:33.599857  INFO    3.0751s    MESSAGE << single[000] (eff829) >> received 2 peers
Jan  7 21:12:33.600087  INFO    3.0761s    MESSAGE << single[000] (eff829) >> connecting to all 2 peers
Jan  7 21:12:33.600127  INFO    3.0761s    MESSAGE << single[000] (eff829) >> node 12D3KooWQNSVMXcuLfAhaeQb7jCPBEDbCTCrwKAwnjh2ikk7MoFz dials peer 12D3KooWHZsecmLWAJsQQgCfdt4a7MuhNvrQ98V9kt4tmY3wkPSe
Jan  7 21:12:33.600704  INFO    3.0751s    MESSAGE << single[001] (42a153) >> received peer: {"addrs":["/ip4/16.3.0.3/tcp/8000/ws/p2p/12D3KooWQNSVMXcuLfAhaeQb7jCPBEDbCTCrwKAwnjh2ikk7MoFz"],"id":"12D3KooWQNSVMXcuLfAhaeQb7jCPBEDbCTCrwKAwnjh2ikk7MoFz"}
Jan  7 21:12:33.600756  INFO    3.0751s    MESSAGE << single[001] (42a153) >> received 2 peers
Jan  7 21:12:33.600784  INFO    3.0761s    MESSAGE << single[001] (42a153) >> connecting to all 2 peers
Jan  7 21:12:33.600818  INFO    3.0761s    MESSAGE << single[001] (42a153) >> node 12D3KooWHZsecmLWAJsQQgCfdt4a7MuhNvrQ98V9kt4tmY3wkPSe dials peer 12D3KooWQNSVMXcuLfAhaeQb7jCPBEDbCTCrwKAwnjh2ikk7MoFz
Jan  7 21:12:33.709371  INFO    3.1851s    MESSAGE << single[001] (42a153) >> connected to 12D3KooWQNSVMXcuLfAhaeQb7jCPBEDbCTCrwKAwnjh2ikk7MoFz: fsk6nh1673125953707 ({"status":"OPEN","direction":"outbound","timeline":{"open":1673125953639,"upgraded":1673125953707},"multiplexer":"/mplex/6.7.0","encryption":"/noise"})
Jan  7 21:12:33.709450  INFO    3.1851s    MESSAGE << single[001] (42a153) >> signalEntry: connected
Jan  7 21:12:33.710711  INFO    3.1861s    MESSAGE << single[000] (eff829) >> connected to 12D3KooWHZsecmLWAJsQQgCfdt4a7MuhNvrQ98V9kt4tmY3wkPSe: 41orqn1673125953708 ({"status":"OPEN","direction":"outbound","timeline":{"open":1673125953639,"upgraded":1673125953708},"multiplexer":"/mplex/6.7.0","encryption":"/noise"})
Jan  7 21:12:33.711319  INFO    3.1871s    MESSAGE << single[000] (eff829) >> signalEntry: connected
Jan  7 21:12:33.729228  INFO    3.2031s    MESSAGE << single[001] (42a153) >> wait for barrier (2): connected
Jan  7 21:12:33.729297  INFO    3.2041s    MESSAGE << single[001] (42a153) >> pinging to all 2 peers
Jan  7 21:12:33.729334  INFO    3.2041s    MESSAGE << single[001] (42a153) >> node 12D3KooWHZsecmLWAJsQQgCfdt4a7MuhNvrQ98V9kt4tmY3wkPSe pings peer 12D3KooWQNSVMXcuLfAhaeQb7jCPBEDbCTCrwKAwnjh2ikk7MoFz
Jan  7 21:12:33.746946  INFO    3.2231s    MESSAGE << single[000] (eff829) >> wait for barrier (2): connected
Jan  7 21:12:33.747846  INFO    3.2231s    MESSAGE << single[000] (eff829) >> pinging to all 2 peers
Jan  7 21:12:33.747907  INFO    3.2241s    MESSAGE << single[000] (eff829) >> node 12D3KooWQNSVMXcuLfAhaeQb7jCPBEDbCTCrwKAwnjh2ikk7MoFz pings peer 12D3KooWHZsecmLWAJsQQgCfdt4a7MuhNvrQ98V9kt4tmY3wkPSe
Jan  7 21:12:33.793004  INFO    3.2681s    MESSAGE << single[000] (eff829) >> ping result (initial) from peer 12D3KooWHZsecmLWAJsQQgCfdt4a7MuhNvrQ98V9kt4tmY3wkPSe: 21
Jan  7 21:12:33.793006  INFO    3.2681s    MESSAGE << single[001] (42a153) >> ping result (initial) from peer 12D3KooWQNSVMXcuLfAhaeQb7jCPBEDbCTCrwKAwnjh2ikk7MoFz: 62
Jan  7 21:12:33.794270  INFO    3.2691s    MESSAGE << single[000] (eff829) >> signalEntry: initial
Jan  7 21:12:33.794290  INFO    3.2701s    MESSAGE << single[001] (42a153) >> signalEntry: initial
Jan  7 21:12:33.796164  INFO    3.2721s    MESSAGE << single[000] (eff829) >> wait for barrier (2): initial
Jan  7 21:12:33.796330  INFO    3.2721s    MESSAGE << single[000] (eff829) >> Bye!
Jan  7 21:12:33.796923  INFO    3.2731s         OK << single[000] (eff829) >> 
Jan  7 21:12:33.797320  INFO    3.2731s    MESSAGE << single[001] (42a153) >> wait for barrier (2): initial
Jan  7 21:12:33.798891  INFO    3.2741s    MESSAGE << single[001] (42a153) >> Bye!
Jan  7 21:12:33.798966  INFO    3.2741s         OK << single[001] (42a153) >> 
Jan  7 21:12:33.801747  INFO    3.2761s    MESSAGE << single[001] (42a153) >> registerTestcaseResult: true
Jan  7 21:12:33.802236  INFO    3.2761s    MESSAGE << single[000] (eff829) >> registerTestcaseResult: true
Jan  7 21:12:33.830657  INFO    all outcomes are complete       {"runner": "local:docker", "run_id": "cestviu0dpen93vs10og"}

@p-shahi
Copy link
Member

p-shahi commented Jan 23, 2023

closing in favor of #104

@p-shahi p-shahi closed this Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants