Page MenuHomeSoftware Heritage

tests: make the kafka_server_base fixture a function scoped one
ClosedPublic

Authored by douardda on Oct 18 2022, 12:15 PM.

Details

Summary

this actually speeds up tests quite a bit (preventing a 30s timeout when
the fixture is actually reused several times in a test session).

Diff Detail

Event Timeline

Build has FAILED

Patch application report for D8697 (id=31409)

Rebasing onto 1f1b03cfbd...

Current branch diff-target is up to date.
Changes applied before test
commit eaf6c57a8407851d27f4acd94bd8bd01bc003841
Author: David Douard <david.douard@sdfa3.org>
Date:   Tue Oct 18 12:03:58 2022 +0200

    tests: make the kafka_server_base fixture a function scoped one
    
    this actually speeds up tests quite a bit (preventing a 30s timeout when
    the fixture is actually reused several times in a test session).

Link to build: https://jenkins.softwareheritage.org/job/DJNL/job/tests-on-diff/222/
See console output for more information: https://jenkins.softwareheritage.org/job/DJNL/job/tests-on-diff/222/console

Harbormaster returned this revision to the author for changes because remote builds failed.Oct 18 2022, 12:16 PM
Harbormaster failed remote builds in B32354: Diff 31409!

Build is green

Patch application report for D8697 (id=31498)

Rebasing onto 2c6d9e05ec...

Current branch diff-target is up to date.
Changes applied before test
commit 04a84dba6a175a509d6f8d4ccde1441b8e352858
Author: David Douard <david.douard@sdfa3.org>
Date:   Tue Oct 18 12:03:58 2022 +0200

    tests: make the kafka_server_base fixture a function scoped one
    
    this actually speeds up tests quite a bit (preventing a 30s timeout when
    the fixture is actually reused several times in a test session).

See https://jenkins.softwareheritage.org/job/DJNL/job/tests-on-diff/226/ for more details.

ardumont added a subscriber: ardumont.

I don't see the difference comparing the master build or the diff build times but wny not ;)

This revision is now accepted and ready to land.Oct 20 2022, 11:07 AM

Yeah, I'm a bit surprised too that this would decrease overall test times, and seems like a latent bug, but this at least doesn't seem to /increase/ test times in this module, so it's probably fine?

I don't see the difference comparing the master build or the diff build times but wny not ;)

on my laptop, it goes from:

~/swh-journal$ git checkout origin/master
~/swh-journal$ pytest swh
[...]
= 53 passed in 196.44s (0:03:16) =

(it varies a bit but stays in the ball bark of 3mn), to

~/swh-journal$ git checkout 04a84dba6a175a509d6f8d4ccde1441b8e352858
~/swh-journal$ pytest swh
[...]
= 53 passed in 129.94s (0:02:09) =

Not sure why it's not the same on jenkins...