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(iroh): Test sync with restarting node #2146

Merged
merged 13 commits into from
May 3, 2024
Merged

Conversation

Frando
Copy link
Member

@Frando Frando commented Apr 4, 2024

Description

  • Add test for resuming sync after a node restart
  • Improve sync logging
  • Return sync finished details over the RPC boundary

This adds a test with the following flow.

  • Node 1: spawn, create doc, create ticket
  • Node 2: join ticket, add entry a
  • Node 1: wait until received a
  • Node 1: shutdown
  • Node 2: add entry b
  • Node 1: restart
  • Node 1: wait until received b
  • Node 2: add entry c
  • Node 1: wait until received c

Also adjusts the logging a bit to be more useful.

Notes & open questions

Change checklist

  • Self-review.
  • Documentation updates if relevant.
  • Tests if relevant.

@Frando Frando changed the base branch from main to feat/relay-tests April 4, 2024 15:17
@dignifiedquire dignifiedquire added this to the v0.14.0 milestone Apr 8, 2024
@Frando Frando force-pushed the feat/sync-test-restart branch from b2fd628 to 5956e48 Compare April 8, 2024 13:39
@Frando Frando changed the base branch from feat/relay-tests to main April 8, 2024 13:40
@dignifiedquire dignifiedquire modified the milestones: v0.14.0, v0.15.0 Apr 10, 2024
@dignifiedquire dignifiedquire modified the milestones: v0.15.0, v0.16.0 Apr 29, 2024
@Frando Frando marked this pull request as draft April 29, 2024 16:38
@Frando
Copy link
Member Author

Frando commented May 1, 2024

CI fails with:

thread 'sync_restart_node' panicked at iroh/tests/sync.rs:1240:9:
Failed to receive or match all events: Event didn't match any matcher: SyncFinished(SyncEvent { peer: PublicKey(icdmm64o2lmqfyxw), origin: Connect(DirectJoin), finished: SystemTime { tv_sec: 1712604867, tv_nsec: 127329051 }, started: SystemTime { tv_sec: 1712604857, tv_nsec: 111028780 }, result: Err("Failed to establish connection") })

edit: found it, it was only a missing insecure_skip_relay_cert_verify

@Frando Frando force-pushed the feat/sync-test-restart branch from 965a751 to 1f4f044 Compare May 2, 2024 08:49
Frando added 3 commits May 2, 2024 12:58
…2259)

## Description

In the relay server, we currently log all connection failures with
`error` severity. This means that whenever a node disconnects while
still in the TLS handshaking phase, we get an error log.:

```
2024-05-02T09:00:38.443215Z ERROR relay server{me=svfacrfjgmv7fjeu}:relay-http-serve:conn{peer=127.0.0.1:33596}: iroh_net::relay::http::server: [HTTPS] relay: failed to handl
e connection: TLS[manual] accept
```

This however is a perfectly fine thing, a node may decide to abort the
connection to a relay whenever it pleases. Especially in tests we often
shutdown while still in the process of connecting to a relay. This is
annoying, because the `error` severity indicates things being wrong
(especially with the stack traces we print on error logs in the CI).

This PR checks if the error is a EOF and if so only prints it as a debug
log.

## Breaking Changes

<!-- Optional, if there are any breaking changes document them,
including how to migrate older code. -->

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->

## Change checklist

- [x] Self-review.
@Frando Frando force-pushed the feat/sync-test-restart branch from 69b611c to 469bf0d Compare May 2, 2024 14:30
@Frando Frando force-pushed the feat/sync-test-restart branch from 469bf0d to 46701f0 Compare May 2, 2024 16:54
@Frando
Copy link
Member Author

Frando commented May 3, 2024

The test passes now, it was just an oversight.

This PR has no real changes. It only adds a test, improves logging, and returns the sync finished details over the RPC boundary.

@Frando Frando marked this pull request as ready for review May 3, 2024 11:43
@Frando Frando requested a review from dignifiedquire May 3, 2024 11:43
@Frando Frando added this pull request to the merge queue May 3, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 3, 2024
@Frando Frando added this pull request to the merge queue May 3, 2024
Merged via the queue into main with commit ec1e1d2 May 3, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants