-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Testing with Complement has gotten so slow - 2 minutes to see test results #13204
Comments
I definitely feel where you're coming from; Complement tests are currently painful to run to the point where it's easy to get distracted on something else whilst waiting for the results to come back. Regarding 'Docker build is too slow': Wonder if we could build the image once and then mount the source tree into the container as an editable install, to avoid needing to rebuild every time? As long as you don't change dependencies, that should be OK. Regarding 'Complement being slow': I'm not sure what to best do about this. We could consider our plan to use checkpointing to checkpoint a running container and then cheaply recreate those, rather than building everything up from scratch each time. Regarding 'Test output no longer streams as it runs': I don't remember this ever being the case. I'm not sure I consider it that important; personally I don't think I'd use the logs except for after they're done, but if you're aware of an easy way to solve that and it bothers you, then why not. I think it would be great if running a single test took more like 5 seconds or less. |
Try sticking |
@reivilibre Great ideas and hope we can get to this point too!
@richvdh Sweet! For some reason I missed this but I see the behavior commented in the relevant Go source code I linked in golang/go#49195 |
@MadLittleMods how are you finding this now that #13279 has landed? |
I hope #13447 will improve this too |
@richvdh It's a big improvement 👍 I'm getting test results after 46s and the Docker build part is taking around 24s. Complement run after #13279
With #13447, I'm seeing results after 45s and the Docker build part is taking around 22s. Complement run after #13447
(just noticed they're both not running any actual tests since that test name has since changed slightly so that is all just Synapse/Complement doing things) |
This has regressed hard (over 3 minutes to get results now). I'm getting test results after 193s and the Docker build part is taking around 160s. Complement run (latest
|
This will be the rust build step, I guess. Maybe we can reorder the dockerfile to cache the rust build output? Otherwise I don't have any great ideas here. |
Out of interest, @MadLittleMods have you found #13735 to have improved this at all? |
I'm getting test results after ~76s and the Docker build part is taking around ~45s. Complement run (latest
|
Thanks. That's heading in the right direction (but is still depressingly high). |
The recent Complement changes to enable dirty runs don't help here when you want to edit synapse and run a single test. Most of the time will be sunk into rebuilding from source every time.
This is what Dendrite does for its local Complement image. It does rebuild the binary via |
It should be noted that since #14548, if you use the |
I used to be able to make a change in Synapse and see Complement results after 20 seconds. Now it takes 1 minute 15 seconds just to build the Docker images at the start. And over 2 minutes to see the test results for running a single Complement test. This makes local dev such a pain
Discussed at https://matrix.to/#/!alCakyySsFIAVfZLDL:matrix.org/$HuKnVFoLYs_uiDNbENnYs_ALqgQKjbhDrm3wbYYkLwI?via=matrix.org&via=element.io&via=termina.org.uk
Docker build is too slow
When I'm just doing feature work, I don't care about workers, I don't care about Postgres (whatever is new and making it slow).
1 minute 15 seconds of Docker building after changing Synapse:
Complement run ./scripts-dev/complement.sh
Relevant code:
synapse/scripts-dev/complement.sh
Lines 89 to 107 in dcc7873
With cache, the Synapse build used to take ~10s seconds, #9610, which has now doubled to ~20 seconds. And the rest was trivial.
Complement being slow
@kegsay pointed out these couple issues which would also slow down single test runs (stopping and shutting down containers):
The deploys at the start seem noticeable now at 20 seconds:
Test output no longer streams as it runs
This is just a related extra.
The tests used to stream out what it was doing as it went instead of only barfing it all up at the end. This used to work until we got multiple packages in Complement (
tests
andcsapi
), matrix-org/complement#215. This doesn't help with making Complement go faster but it does help with the feeling of it doing something vs just waiting around arbitrarily.The way I workaround it now is to remove the
...
from the end ofsynapse/scripts-dev/complement.sh
Line 164 in dcc7873
so it only runs against the single
tests
package where the feature work I care about is in.The text was updated successfully, but these errors were encountered: