Merge lp:~diegosarmentero/ubuntuone-client/darwin4-fsevents into lp:ubuntuone-client
| Status: | Merged | ||||
|---|---|---|---|---|---|
| Approved by: | Alejandro J. Cura on 2012-07-12 | ||||
| Approved revision: | 1299 | ||||
| Merged at revision: | 1274 | ||||
| Proposed branch: | lp:~diegosarmentero/ubuntuone-client/darwin4-fsevents | ||||
| Merge into: | lp:ubuntuone-client | ||||
| Prerequisite: | lp:~mandel/ubuntuone-client/clean-fsevents | ||||
| Diff against target: |
783 lines (+647/-9) 4 files modified
tests/platform/filesystem_notifications/test_darwin.py (+637/-0) tests/platform/filesystem_notifications/test_filesystem_notifications.py (+5/-0) tests/platform/filesystem_notifications/test_windows.py (+2/-2) ubuntuone/platform/filesystem_notifications/darwin.py (+3/-7) |
||||
| To merge this branch: | bzr merge lp:~diegosarmentero/ubuntuone-client/darwin4-fsevents | ||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Alejandro J. Cura (community) | 2012-07-11 | Approve on 2012-07-12 | |
| Manuel de la Peña (community) | Approve on 2012-07-12 | ||
|
Review via email:
|
|||
This proposal supersedes a proposal from 2012-06-25.
Commit Message
- Adding filesystem notifications feature for darwin (LP: #1013323)
Description of the Change
Now you can execute:
./run-mac-tests tests/platform/
| Manuel de la Peña (mandel) wrote : | # |
The diff is misleading because it should depend on lp:~mandel/ubuntuone-client/clean-fsevents. Diego can you do a resummit with the correct dependency so that we are not scared regading the size :)
| Diego Sarmentero (diegosarmentero) wrote : | # |
Answering alecu:
* Why is test_file_
This is marked for fix in
There is a bug for this, in which i'm working on:
https:/
The rest of the things has been fixed.
| Manuel de la Peña (mandel) wrote : | # |
Looks like there is a thread somewhere that is not killed in the tests. I'm running the tests via u1trial and once they are done the process does not stop.
- 1296. By Diego Sarmentero on 2012-07-11
-
removing time.sleep
| Diego Sarmentero (diegosarmentero) wrote : | # |
> Looks like there is a thread somewhere that is not killed in the tests. I'm
> running the tests via u1trial and once they are done the process does not
> stop.
Fixed!
| Alejandro J. Cura (alecu) wrote : | # |
The tearDown in TestWatchManager should not be calling self.patch.
In the same tearDown, the deferred returned by self.manager.stop() should be yielded on.
---
typos:
"""Test that we can get a Watch using is wd.""" ->
"""Test that we can get a Watch using its wd."""
---
This line should not be part of the tests; it should be part of the stopping of the watcher thread:
self.manager.
That part of the code (stopping the watcher thread) is particularly dirty: I just found that there's a __del__ in WatchManager that we missed on the review of the previous branch, and that should not be there, since the use of __del__ is discouraged in python, and much more so when it's being used to work around a thread not being correctly finished.
I think that the stop method should be returning a deferred that's fired when the join is done; but please, let's discuss together a better solution to this on IRC or Mumble.
---
- 1297. By Diego Sarmentero on 2012-07-12
-
adding join on stop
- 1298. By Diego Sarmentero on 2012-07-12
-
moving patch to setUp
- 1299. By Diego Sarmentero on 2012-07-12
-
reverting
| Manuel de la Peña (mandel) wrote : | # |
Looks goo to me knowing that we will merge this tests later.
| Alejandro J. Cura (alecu) wrote : | # |
I still would like better handling of the watches being stopped, so for that I'm creating a different bug: #1024102
Otherwise the code here looks ok.


The branch looks mostly fine.
A few questions, though:
* Why is test_file_ moved_from_ partial skipped? I think this is a critical operation that should be tested.
* Why is there a test that still uses time.sleep? As mentioned in previous branches we should not be using sleep at all in tests.
And some fixes needed, too:
It looks wrong to import fsevents in /platform/ filesystem_ notifications/ __init_ _.py, so please, move each platform specific definition of EVENT_CODES to ubuntuone. platform. filesystem_ notifications. windows and .darwin
---
Lines 827 and 828 are duplicated.
---
Please move the logic in these few lines to a function, add some unit tests for it, and use it from both places:
837 + index = 0 endswith( os.path. sep): self._path) + index:]
838 + if not self._path.
839 + index = 1
840 + path = path[len(