Bug #10124

[FUSE] Fix flaky test FuseUpdateFromEventTest

Added by Tom Clegg over 4 years ago. Updated over 4 years ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
-
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Story points:
-

Associated revisions

Revision c2fdf5d2
Added by Tom Clegg over 4 years ago

Merge branch '10124-fix-sleepy-tests' closes #10124

History

#1 Updated by Radhika Chippada over 4 years ago

Review comments:

  • AssertWithin might be clearer if AssertWithinInterval? Also, instead of “seconds” can you please call it “interval”?
  • In AssertWithin -> attempt, can you add a "time expired" message to "raise" when "time.time() > self.deadline"?
  • Am I understanding it correctly (sorry, python) that if AssertWithin -> attempt, if the “fn” fails for any other errors, they will be raised and the test will fail as needed?

#2 Updated by Tom Clegg over 4 years ago

Radhika Chippada wrote:

  • AssertWithin might be clearer if AssertWithinInterval? Also, instead of “seconds” can you please call it “interval”?

Changed to AssertWithTimeout(timeout=x) -- timeout seems to be the customary Python word for this.

  • In AssertWithin -> attempt, can you add a "time expired" message to "raise" when "time.time() > self.deadline"?

"raise" by itself raises the original assertion error with test's own message, which seems more useful. For example, changing the timeout from 10 to 0.00001 results in

runTest (tests.test_mount.FuseUpdateFromEventTest) ... FAIL

======================================================================
FAIL: runTest (tests.test_mount.FuseUpdateFromEventTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tom/src/arvados/services/fuse/tests/test_mount.py", line 744, in runTest
    attempt(self.assertEqual, ["file1.txt"], llfuse.listdir(os.path.join(self.mounttmp)))
  File "/home/tom/src/arvados/services/fuse/tests/test_mount.py", line 44, in attempt
    fn(*args, **kwargs)
AssertionError: Lists differ: ['file1.txt'] != []

First list contains 1 additional elements.
First extra element 0:
file1.txt

- ['file1.txt']
+ []
  • Am I understanding it correctly (sorry, python) that if AssertWithin -> attempt, if the “fn” fails for any other errors, they will be raised and the test will fail as needed?

Yes, that's right.

#3 Updated by Radhika Chippada over 4 years ago

  • Assigned To set to Tom Clegg

#4 Updated by Tom Clegg over 4 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 100

Applied in changeset arvados|commit:c2fdf5d225efe65edcab383b213eca27e2cca30e.

Also available in: Atom PDF