#4751 test_request_pull_close is non-deterministic
Closed: Fixed 4 years ago by pingou. Opened 4 years ago by sergiodj.

While preparing the Debian pagure package to run its testsuite, I noticed that test_request_pull_close is non-deterministic and can fail depending on the system load.

The test expects (at many places) to see a string like:

Merged just now...

However, in my system, the string was actually:

Merged seconds ago...

This made the test fail. I don't know if assertIn can be made to expect a regexp; I'll try to investigate this further. Meanwhile, I thought it'd be good to file this bug for the record.


We have regex tests already, but the approach is different: use an standard Python re.match(), then assert on its result :)

I couldn't find the re.match() tests, so I went ahead and prepared a patch with assertRegex. I'll create the PR in a few minutes.

Login to comment on this ticket.

Metadata
Related Pull Requests
  • #4752 Merged 4 years ago