Commit Graph

6981 Commits

Author SHA1 Message Date
Brian Warner 7182172fc7 Merge branch 'pr310'
refs ticket:2804
2016-08-11 23:20:54 -07:00
meejah c3035dc409 remove unnecessary error-handling 2016-08-10 19:44:26 -06:00
meejah 75a218d80f Show last time for successful scans too 2016-08-10 19:44:14 -06:00
meejah 8a33fc612a Add magic-folder indicator to main welcome page
This doesn't reveal very much information, but does tell
you if magic-folder is currently working and if not it will
indicate when the last attempt to do a remote scan was.
2016-08-09 18:07:00 -06:00
meejah a6920d9799 Improve error-reporting from JSON APIs, and use it better in CLI
Improve error-handling for directories if you ask for JSON from
the /uri endpoint, but an error occurs (you get a proper HTTP
status code and a valid JSON object).

For 'tahoe magic-folder status' e now retrieve *all* the remote data
required in the CLI before doing anything else so that errors can be
shown immediately. Use the improved JSON endpoints to print better
errors.
2016-08-09 14:36:09 -06:00
Brian Warner af1e2a1e2f node.py: advise twistd.log readers about flogtool 2016-08-09 15:27:33 -04:00
meejah 69b86ebe9a Improve startup error-reporting
This keeps re-trying the initial magic-folder scan and alerts
the user (via logs only :/) until it succeeds at least once.

After this happens and the node has started up, it will continue
to re-try if enough storage servers go away later such that the
remote collection can't be retrieved.
2016-08-09 14:16:11 -04:00
meejah fd978bfed6 whitespace, and add 'tox' to 'test' extra 2016-08-08 12:35:54 -06:00
Brian Warner 594dd26285 Merge branch '20-improve-tests'
This reduces the 'tox -e coverage' test time (on travis) by 40%, from
1711s to 1014s.

refs ticket:20
2016-08-05 20:15:19 -04:00
Brian Warner 8ca653c30d no_network: turn off control_tub and log_tub
These aren't needed for most tests, and saves about 7% of the total test
runtime (on my laptop, it drops from 844s to 786s).
2016-08-05 19:33:49 -04:00
Brian Warner a35073cb3d test.common: allow test_repairer to be run independently
Previously, this file importing "allmydata.immutable" but assuming that
"allmydata.immutable.upload" was available, which only worked if some
other file had imported upload.py . This didn't affect running the
entire test suite (something imported upload.py before anything else
needed it), but caused errors when running specific tests like
test_repairer.py .
2016-08-05 18:26:18 -04:00
Brian Warner cd083b9a04 move SystemTestMixin from common.py to test_system.py
It's only being used in test_system.py anyways, so having it live in a
"common" file didn't provide much value.
2016-08-04 01:09:12 -04:00
Brian Warner 4f0e71db4a split test_web.py into smaller files
there's more to be done, but this is a start
2016-08-03 20:46:12 -04:00
Brian Warner 421520ade4 test_magic_folder: use oneshare=True too
I can't currently test this (my OS-X laptop can't run those tests), but
based on how much time test_magic_folder takes on the buildbots, I
expect oneshare=True to help considerably.
2016-08-03 19:11:01 -04:00
Brian Warner 6dd58ceb2a tests: use oneshare=True on more test cases
This saves more time (as measured on my laptop):

* test_sftp: 17.7s -> 13s
* test_dirnode: 26.5s -> 20s
* test_ftp, test_configutil, test_web show negligible speedups

As before, some tests care about the number of shares, generally ones
which delete or corrupt shares and then expect to see the errors get
noticed or fixed. Those tests continue to use k=3/N=10.
2016-08-03 19:11:01 -04:00
Brian Warner 22d032ef2e test.cli: use oneshare=True, reduce runtime by 50%
Most of the CLI tests don't care about the actual shares. Configuring
the test client to use k=N=1 reduces the runtime from 180s to 90s on my
laptop.

A few tests *do* care, like test_check (which delete some shares, then
assert that 'tahoe check' shows the damage). These still use k=3/N=10.
2016-08-03 19:11:01 -04:00
Brian Warner 50df45e3a0 add GridTestMixin.set_up_grid(oneshare=True)
This configures client[0] to use k=N=1, which is a lot faster for tests
that don't care about the actual shares (e.g. most of the CLI tests).
2016-08-03 19:11:01 -04:00
Brian Warner e431faf58c test_cli_*: move files into test/cli/* 2016-08-03 19:10:53 -04:00
Brian Warner f11769560c test.mutable.Update: stop exercising max_shares
Many of the test cases would exercise two copies of each file: one with
k=3/N=10, and a second with k=127/N=255 (255 being the maximum supported
by zfec).

Large number of shares increases the overhead of the testing apparatus,
which is pushing those shares to lots of local servers.

I don't think the "max_shares" case is necessary, and it takes forever.
Because of it, "mutable.Update" was consuming 15% of the total test
runtime, and a third of that was just a single
function (test_replace_locations_max_shares, now deleted). On a
Raspberry Pi 3 (our "slow computer" benchmark), including branch
coverage, this one class took 42 minutes to complete, and requires
disabling a bunch of timeouts to finish at all.

The total number of shares in a file ("N") affects one thing: the
width (and thus height) of the share hash tree. This should be exercised
in test_hashtree.

The number of required shares ("k") affects one thing: the segment size
must be a multiple of k. I don't think we need to exercise this, but if
so, it could be exercised by a few small values for k, rather than 127.

Removing the max_shares cases saves 82% of the mutable.update
runtime (on top of the previous three-segment fix), reducing it from 64s
to 11.3s on my laptop.
2016-08-03 15:32:01 -04:00
Brian Warner 1bdae637e1 test.mutable.update: reduce data size in half
We only need three segments to exercise everything. This saves about 15%
of the test.mutable runtime (from 76s to 64s on my laptop).
2016-08-03 15:08:10 -04:00
Brian Warner dbd78f19d2 test.mutable.update: minor refactoring 2016-08-03 15:07:51 -04:00
Brian Warner 4f56c4b053 split test_mutable.py into smaller files 2016-08-03 14:54:32 -04:00
Brian Warner 6f8c96e262 oops, fix NoNetworkStorageBroker to match 2016-07-21 18:13:28 -07:00
Brian Warner 1b64ab5e85 simplify when_connected_enough()
This seems happier as a method on StorageBroker, rather than a
completely separate helper class.
2016-07-21 17:23:22 -07:00
Brian Warner c15d706faf travis: Disable coverage on OS-X build, times out
refs ticket:2800
2016-07-21 15:07:46 -07:00
Brian Warner d6d264f31c Merge 'pr295': add magic-folders to replace drop-upload
* Closes tahoe-lafs#295 (in rebased form)
* refs ticket:2438
2016-07-21 14:22:33 -07:00
meejah 88cd4cb6c2 skip all tests w/o inotify support 2016-07-21 12:35:59 -07:00
meejah 87acfe968e pyflakes warnings 2016-07-21 12:35:59 -07:00
meejah 4e0a30ab91 get rid of more win32 special-casing 2016-07-21 12:35:59 -07:00
meejah 1ac6c9bdf6 remove special-case win32 2016-07-21 12:35:59 -07:00
meejah 161c876f2f make tests reflect reality 2016-07-21 12:35:59 -07:00
meejah 46f1f952e9 tighten delay on windows tests 2016-07-21 12:35:59 -07:00
meejah e182562dbe remove tub.location from smoke_test config for storage nodes 2016-07-21 12:35:59 -07:00
meejah 041aabd8c4 Error-handling and --debug option to print stack-trace for all magic-folder commands 2016-07-21 12:35:59 -07:00
meejah 4509c7dafd Fix magic-folder 'status' command 2016-07-21 12:35:59 -07:00
meejah db40417886 make check_magicfolder_smoke easier to run, cross-platform 2016-07-21 12:35:59 -07:00
meejah 1b72683741 get rid of more spew 2016-07-21 12:35:59 -07:00
meejah e9343c8715 fix typo 2016-07-21 12:35:59 -07:00
meejah efef4ae632 only use long delay on windows 2016-07-21 12:35:59 -07:00
meejah fc5f820202 whitespace 2016-07-21 12:35:59 -07:00
meejah 516af88252 put longer timeout for test_alice_bob back in 2016-07-21 12:35:59 -07:00
meejah a533aef960 remove delayedcall debugging 2016-07-21 12:35:59 -07:00
meejah 304da362f7 remove prints 2016-07-21 12:35:59 -07:00
meejah ec11551404 slightly better way to find tahoe binary 2016-07-21 12:35:59 -07:00
meejah 18f799bdc8 remove incorrect override 2016-07-21 12:35:59 -07:00
meejah 34aed4bbad fixup remove debug 2016-07-21 12:35:59 -07:00
meejah e060c584d7 fixup for pending-call calls 2016-07-21 12:35:59 -07:00
meejah 3de2f9c756 get rid of a bunch of debug 2016-07-21 12:35:59 -07:00
meejah db6717951f properly cancel pending-call things in windows inotify 2016-07-21 12:35:59 -07:00
meejah fce5b789dc fixup rebase conflict mis-resolutions 2016-07-21 12:35:59 -07:00