mirror of
https://gerrit.googlesource.com/git-repo
synced 2026-10-04 20:47:07 +00:00
The trace2 socket test uses a Condition to wait for its server to start listening. If the server calls notify() before the test starts waiting, the notification is lost and the test waits for the full 120-second timeout before continuing. Use an Event for the readiness signal instead. Once the server starts listening, the event stays set, so the test can continue immediately even if the server becomes ready before the test starts waiting. Change-Id: I0e8e192d997c8bd785bcefa5d5b91493f93863e8 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/630861 Tested-by: Victor Pushkarev <corvinus.v@gmail.com> Reviewed-by: Mike Frysinger <vapier@google.com> Reviewed-by: Gavin Mak <gavinmak@google.com> Commit-Queue: Victor Pushkarev <corvinus.v@gmail.com>
Repo Tests
There is a mixture of pytest & Python unittest in here. We adopted pytest later on but didn't migrate existing tests (since they still work). New tests should be written using pytest only.
File layout
test_xxx.py: Unittests for thexxxmodule in the main repo codebase. Modules that are in subdirs normalize the/into_. For example, test_error.py is for the error.py module, and test_subcmds_forall.py is for the subcmds/forall.py module.- conftest.py: Custom pytest fixtures for sharing.
- utils_for_test.py: Helpers for sharing in tests.