#4752 Use assertRegex instead of assertIn to avoid non-determinism failures
Merged by pingou. Opened by sergiodj.
sergiodj/pagure non-deterministic-tests-fix  into  master

Download 4752.patch

Depending on the system load, we might see messages containing "just
now" or "seconds ago". For example:

"Merged just now..."

vs.

"Merged seconds ago..."

If we only look for "just now", we are obviously going to fail when
the system takes some time to process a request, and "seconds ago" is
displayed. This commit addresses this problem by using a regex when
matching the text, and expecting both patterns.

Fixes #4751

Signed-off-by: Sergio Durigan Junior sergiodj@sergiodj.net

rebased onto 9f4670f625a9c05156e018b43063657f5074460a

rebased onto a58b4bc18d4556cff93b2ad0c6bb919e5bf25bd8

rebased onto 6ae1910692211613a5f9f1168d1a2e0a9f1b4224

AttributeError: 'PagureFlaskForktests' object has no attribute 'assertRegex'

Looks like the unit-test version in CentOS7 is too old :(

rebased onto ea7bf28d834bf69bebc72752a05f9e17ff757b71

rebased onto 27df61ccbe36adf7bc6dba7966bd44d6ebfd3da4

@sergiodj I've adjusted the code to rely on re.search which according to the doc is what assertRegex does, this way we should be compatible with the unit-tests version that is in CentOS/RHEL7.

Cool, thanks @pingou!

rebased onto 1c9abcd1de8c4e85f629ceae9b6d17aec08dfb94

Jenkins is happy, let's get this in, quick!

Pull-Request has been merged by pingou

Metadata