Skip to content

Add simple integration test between Channel and Router#2270

Merged
pm47 merged 9 commits intomasterfrom
router-test-improvements-2
May 19, 2022
Merged

Add simple integration test between Channel and Router#2270
pm47 merged 9 commits intomasterfrom
router-test-improvements-2

Conversation

@pm47
Copy link
Member

@pm47 pm47 commented May 13, 2022

This is a simpler alternative to #2268.

In this PR we add a basic integration test between Channel and Router that checks the proper handling of local announcements.

This test found two bugs, fixed in two separate commits.

@pm47 pm47 force-pushed the router-test-improvements-2 branch from 565291d to 90b55bf Compare May 13, 2022 16:51
@pm47 pm47 marked this pull request as draft May 13, 2022 17:06
@pm47 pm47 force-pushed the router-test-improvements-2 branch from 600c12f to d48f9fd Compare May 16, 2022 15:00
pm47 added a commit that referenced this pull request May 17, 2022
From scalatest's `ParallelTestExecution` doc:

> ScalaTest's normal approach for running suites of tests in parallel is to run different suites in parallel, but the tests of any one suite sequentially.
> [...]
> To make it easier for users to write tests that run in parallel, this trait runs each test in its own instance of the class. Running each test in its own instance enables tests to use the same instance vars and mutable objects referenced from instance variables without needing to synchronize. Although ScalaTest provides functional approaches to factoring out common test code that can help avoid such issues, running each test in its own instance is an insurance policy that makes running tests in parallel easier and less error prone.

This means that for each single test of the `channel.states` package, we instantiate one actor system, which contains two thread pools. With default settings, that's a minimum of 2*8 threads per individual test.

That's already pretty bad, and with 65cf238 (#2270) we add a factor of 3 on top of that, which makes us go past the OS limits on github CI.

setup | peak thread count | run time
-------|---------------------|----
baseline | 5447 | 5m 44s
sequential | 1927 | 5m 9s (*)

(*) It's actually so bad, that tests run actually faster without parallelization!
pm47 added 7 commits May 17, 2022 10:04
The test currently fails, which looks like a bug to me. When a local
channel graduates from private to public, we do not copy existing
known `channel_update`s. Current implementation guarantees that we
will process our local `channel_update` immediately, but what about our
peer?
We fix a second bug where gossip origin wasn't properly set for local
announcements
@pm47 pm47 force-pushed the router-test-improvements-2 branch from d48f9fd to 3041276 Compare May 17, 2022 08:05
@pm47 pm47 requested a review from t-bast May 17, 2022 08:28
@pm47 pm47 marked this pull request as ready for review May 17, 2022 08:28
Copy link
Member

@t-bast t-bast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool stuff!

@pm47 pm47 requested a review from t-bast May 18, 2022 15:53
Copy link
Member

@t-bast t-bast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@pm47 pm47 merged commit bb7703a into master May 19, 2022
@pm47 pm47 deleted the router-test-improvements-2 branch May 19, 2022 07:40
pm47 added a commit that referenced this pull request Jun 3, 2022
pm47 added a commit that referenced this pull request Jun 3, 2022
pm47 added a commit that referenced this pull request Jun 6, 2022
pm47 added a commit that referenced this pull request Jun 6, 2022
pm47 added a commit that referenced this pull request Jun 8, 2022
pm47 added a commit that referenced this pull request Jun 8, 2022
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