Commit Graph

8462 Commits

Author SHA1 Message Date
Jean-Paul Calderone
a84b278ecd support older pythons 2022-12-02 08:26:15 -05:00
Jean-Paul Calderone
9619e286f4 Switch the web testing double to BytesKeyDict
This will catch more str/bytes errors by default than `dict`
2022-12-02 08:16:02 -05:00
meejah
20b3594d12 exarkun wants a helper 2022-12-01 17:05:58 -07:00
meejah
36ed554627 proto -> transport 2022-12-01 17:03:48 -07:00
meejah
3d43cbccc9 log less-specific failures 2022-12-01 17:01:38 -07:00
meejah
c57d1aa8a9 Merge branch 'master' into 3921.exit-on-stdin-close 2022-12-01 16:58:37 -07:00
meejah
7ffcfcdb67
Update src/allmydata/test/test_runner.py
Co-authored-by: Jean-Paul Calderone <exarkun@twistedmatrix.com>
2022-12-01 16:47:40 -07:00
Itamar Turner-Trauring
c93ff23da7 Don't send empty string writes. 2022-12-01 14:54:28 -05:00
Itamar Turner-Trauring
8ed333b171 Correct explanation. 2022-12-01 14:45:45 -05:00
Itamar Turner-Trauring
0ba58070cd Tweaks. 2022-12-01 14:45:39 -05:00
Itamar Turner-Trauring
d4c202307c Better method name. 2022-12-01 14:43:49 -05:00
Itamar Turner-Trauring
17dfda6b5a More direct API. 2022-12-01 14:42:52 -05:00
Jean-Paul Calderone
05dfa875a7 Quite a mypy warning about formatting bytes into a string 2022-11-30 09:46:13 -05:00
Jean-Paul Calderone
156954c621 no longer any need to "daisy chain" this value 2022-11-30 09:43:01 -05:00
Jean-Paul Calderone
a11eeaf240 Convert all of the asynchronous functions to use async and await 2022-11-30 09:30:37 -05:00
Jean-Paul Calderone
1acf8604ef Remove the Py2/Py3 compatibility header 2022-11-30 09:30:08 -05:00
Jean-Paul Calderone
5cebe91406 update the module docstring 2022-11-30 09:29:57 -05:00
Jean-Paul Calderone
02aeb68f17 Take care with str vs bytes in the implementation
Also replace the intentional BAD_REQUEST with GONE for this case.
2022-11-29 10:51:07 -05:00
Jean-Paul Calderone
d7fe25f7c7 Correct the assertion about how "not found" should be handled
Behavior verified visually against a live client node:

```
❯ curl -v 'http://localhost:3456/uri/URI:CHK:cmtcxq7hwxvfxan34yiev6ivhy:qvcekmjtoetdcw4kmi7b3rtblvgx7544crnwaqtiewemdliqsokq:1:1:1'
*   Trying 127.0.0.1:3456...
* Connected to localhost (127.0.0.1) port 3456 (#0)
> GET /uri/URI:CHK:cmtcxq7hwxvfxan34yiev6ivhy:qvcekmjtoetdcw4kmi7b3rtblvgx7544crnwaqtiewemdliqsokq:1:1:1 HTTP/1.1
> Host: localhost:3456
> User-Agent: curl/7.83.1
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 410 Gone
< X-Frame-Options: DENY
< Referrer-Policy: no-referrer
< Server: TwistedWeb/22.10.0
< Date: Tue, 29 Nov 2022 15:39:47 GMT
< Content-Type: text/plain;charset=utf-8
< Accept-Ranges: bytes
< Content-Length: 294
< ETag: ui2tnwl5lltj5clzpyff42jdce-
<
NoSharesError: no shares could be found. Zero shares usually indicates a corrupt URI, or that no servers were connected, but it might also indicate severe corruption. You should perform a filecheck on this object to learn more.

The full error message is:
* Connection #0 to host localhost left intact
no shares (need 1). Last failure: None
```
2022-11-29 10:49:20 -05:00
Jean-Paul Calderone
920467dcea Treat missing Authorization as the same as empty Authorization 2022-11-29 10:19:01 -05:00
Jean-Paul Calderone
f5b24d51e9 Add a test for missing Authorization 2022-11-29 10:18:57 -05:00
Itamar Turner-Trauring
06b57cd835 Merge remote-tracking branch 'origin/master' into 3939-faster-http-protocol 2022-11-28 11:07:01 -05:00
Itamar Turner-Trauring
aa80c9ef47 Be more robust. 2022-11-28 10:21:59 -05:00
Itamar Turner-Trauring
3ba166c2cb A bit more robust code. 2022-11-28 10:20:12 -05:00
Itamar Turner-Trauring
0f4dc91295 Refactor so internal attributes needn't leak. 2022-11-28 10:12:08 -05:00
Itamar Turner-Trauring
38d7430c57 Simplify. 2022-11-28 10:03:42 -05:00
Itamar Turner-Trauring
2ab8e3e8d2 Cancel timeout on failures too. 2022-11-28 10:02:56 -05:00
Itamar Turner-Trauring
41533f162e Not used anymore. 2022-11-23 10:20:32 -05:00
Itamar Turner-Trauring
3790280264 Documentation. 2022-11-23 10:16:49 -05:00
Itamar Turner-Trauring
fd9e50adf1 Simplify _WriteBuffer slightly. 2022-11-23 10:13:18 -05:00
Itamar Turner-Trauring
d1deda5fdd Unit tests for _WriteBuffer. 2022-11-23 10:09:53 -05:00
Itamar Turner-Trauring
7f1d7d4f46 Better explanation. 2022-11-23 09:53:07 -05:00
Itamar Turner-Trauring
d86d578034 Refactor to make core data structure easier to test in isolation. 2022-11-22 15:17:56 -05:00
Itamar Turner-Trauring
f638aec0af Refactor to use BytesIO. 2022-11-22 14:22:54 -05:00
Itamar Turner-Trauring
a4787ca45e Batch writes much more aggressively. 2022-11-22 14:12:14 -05:00
Itamar Turner-Trauring
c80469b50b Handle the Windows waker too. 2022-11-22 11:55:56 -05:00
Itamar Turner-Trauring
3a613aee70 Try a different approach to timeouts: dynamic, instead of hardcoded. 2022-11-21 12:24:50 -05:00
Itamar Turner-Trauring
8cfdae2ab4 sigh 2022-11-18 15:26:02 -05:00
Itamar Turner-Trauring
aeaced848d Merge remote-tracking branch 'origin/master' into 3940-http-timeouts 2022-11-18 15:25:44 -05:00
Itamar Turner-Trauring
4c0c75a034 Fix DelayedCall leak in tests. 2022-11-18 13:56:54 -05:00
Itamar Turner-Trauring
9b21f1da90 Increase how many statuses are stored. 2022-11-17 11:35:10 -05:00
Itamar Turner-Trauring
d182a2f186 Add the delay to appropriate test. 2022-11-17 11:01:12 -05:00
Itamar Turner-Trauring
097d918a24 Sigh 2022-11-16 13:37:50 -05:00
Itamar Turner-Trauring
3531737347 Make timeouts less aggressive, CI machines are slow? 2022-11-16 10:36:11 -05:00
Itamar Turner-Trauring
2ab172ffca Try to set more aggressive timeouts when testing. 2022-11-16 10:26:29 -05:00
Itamar Turner-Trauring
9f5f287473 Nope, not helpful. 2022-11-16 09:57:39 -05:00
Itamar Turner-Trauring
a20943e10c As an experiment, see if this fixes failing CI. 2022-11-16 09:33:01 -05:00
Itamar Turner-Trauring
2a5e8e5971 Better cleanup. 2022-11-15 15:05:27 -05:00
Itamar Turner-Trauring
30a9877236 Merge branch '3783-storage-client-http' into 3940-http-timeouts 2022-11-15 14:38:48 -05:00
Itamar Turner-Trauring
f3fc426830 Switch to [storage] force_foolscap. 2022-11-15 14:36:14 -05:00
Itamar Turner-Trauring
fb52b4d302 Delete some garbage. 2022-11-15 14:22:30 -05:00
Itamar Turner-Trauring
8e4ac69032 Stop test mode when done. 2022-11-15 14:21:31 -05:00
Itamar Turner-Trauring
4aeb62b66c Use a constant. 2022-11-15 14:16:41 -05:00
Itamar Turner-Trauring
d700163aec Remove no-longer-relevant comment. 2022-11-15 14:14:29 -05:00
Itamar Turner-Trauring
6c80ad5290 Not necessary. 2022-11-15 14:13:50 -05:00
Itamar Turner-Trauring
d1287df629 The short timeout should be specific to the storage client's needs. 2022-11-15 14:02:19 -05:00
Itamar Turner-Trauring
8d678fe3de Increase timeout. 2022-11-07 11:41:50 -05:00
Itamar Turner-Trauring
65a7945fd9 Don't need a connection timeout since we have request-level timeouts. 2022-11-07 11:39:45 -05:00
Itamar Turner-Trauring
2c911eeac1 Make sure everything is using the same clock. 2022-11-07 11:28:36 -05:00
Itamar Turner-Trauring
f8b9607fc2 Finish up limited_content() timeout code. 2022-11-07 11:26:11 -05:00
Itamar Turner-Trauring
ce59ddc1ea Merge branch '3783-storage-client-http' into 3940-http-timeouts 2022-11-07 11:20:54 -05:00
Itamar Turner-Trauring
c4772482ef WIP 2022-11-07 11:19:00 -05:00
Itamar Turner-Trauring
414b463556 Use built-in treq timeout feature. 2022-11-07 09:23:04 -05:00
Itamar Turner-Trauring
1e50e96e24 Update to new test API. 2022-11-03 15:04:41 -04:00
Itamar Turner-Trauring
8bebb09edd Less test-specific way to make test_rref pass. 2022-11-03 14:38:59 -04:00
Itamar Turner-Trauring
262d9d85b9 Switch to using persistent connections in tests too. 2022-11-03 14:32:43 -04:00
Itamar Turner-Trauring
e05136c238 Less aggressive timeout, to try to make tests pass on CI. 2022-11-02 13:13:21 -04:00
Itamar Turner-Trauring
48ae729c0d Don't reuse basedir across tests. 2022-11-02 10:18:23 -04:00
Itamar Turner-Trauring
73271afa65 Merge remote-tracking branch 'origin/master' into 3783-storage-client-http 2022-11-02 09:23:29 -04:00
Itamar Turner-Trauring
1a3e3a86c3 Require latest pycddl, and work around a regression. 2022-10-14 11:27:04 -04:00
Itamar Turner-Trauring
0febc87456 Don't include reactor in comparison. 2022-10-14 10:03:06 -04:00
Itamar Turner-Trauring
e409262e86 Fix some flakes. 2022-10-14 09:50:07 -04:00
Itamar Turner-Trauring
42d3843343 Run test_system with both Foolscap and HTTP storage protocols, plus some
resulting cleanups.
2022-10-14 09:16:59 -04:00
Itamar Turner-Trauring
0f31e3cd4b Leave HTTP off by default for now. 2022-10-13 14:41:59 -04:00
Itamar Turner-Trauring
b80a215ae1 test_rref passes now. 2022-10-13 14:15:10 -04:00
Itamar Turner-Trauring
0d23237b11 Some progress towards passing test_rref. 2022-10-13 13:44:49 -04:00
Itamar Turner-Trauring
8b0ddf406e Make HTTP and Foolscap match in another edge case. 2022-10-04 11:17:19 -04:00
Itamar Turner-Trauring
8190eea489 Fix bug introduced in previous commit. 2022-10-04 11:02:36 -04:00
Itamar Turner-Trauring
ea1d248611 These objects get stored in a context where they need to be hashed, sometimes. 2022-10-04 10:51:43 -04:00
Itamar Turner-Trauring
1294baa82e LoopingCall may already have been stopped. 2022-10-04 10:30:27 -04:00
Itamar Turner-Trauring
fd07c092ed close() is called while writes are still happening. 2022-10-04 10:30:07 -04:00
Itamar Turner-Trauring
8b2884cf3a Make changes work again. 2022-10-04 09:44:30 -04:00
Itamar Turner-Trauring
1ea716c8bf Merge branch '3902-listen-storage-http' into 3783-storage-client-http 2022-10-04 09:22:49 -04:00
Itamar Turner-Trauring
c13be0c89b Try harder to cleanup. 2022-10-04 09:19:48 -04:00
Itamar Turner-Trauring
58247799c1 Fix remaining references to refactored-out-of-existence API. 2022-10-03 11:27:19 -04:00
Itamar Turner-Trauring
3034f35c7b Document type expectations. 2022-10-03 11:24:53 -04:00
Itamar Turner-Trauring
5d53cd4a17 Nicer API. 2022-10-03 11:16:30 -04:00
Itamar Turner-Trauring
d918135a0d Use parser instead of ad-hoc parser. 2022-10-03 11:10:36 -04:00
Itamar Turner-Trauring
d753bb58da Better type for storage_nurls. 2022-10-03 11:05:56 -04:00
Itamar Turner-Trauring
b0fb72e379 Link to design issue. 2022-10-03 11:02:48 -04:00
Itamar Turner-Trauring
8179ea7738 Merge remote-tracking branch 'origin/master' into 3902-listen-storage-http 2022-10-03 10:56:17 -04:00
Itamar Turner-Trauring
bd74c3d971
Merge pull request #1216 from tahoe-lafs/3904-http-storage-holistic
Address various http storage holistic review comments
2022-10-03 09:13:30 -04:00
meejah
d2dd211420
Merge pull request #1219 from meejah/3926.pid-time-reactor
3926: upgrade PID files to contain start-time, do file-locking and exist on Windows
2022-09-28 11:02:46 -06:00
meejah
bef71978b6 don't need start_new_session 2022-09-28 10:15:03 -06:00
meejah
ca522a5293 sys.argv not inline 2022-09-28 10:14:59 -06:00
meejah
8991509f8c blackslashes.... 2022-09-25 00:16:40 -06:00
meejah
f2cfd96b5e typo, longer timeout 2022-09-23 01:04:58 -06:00
meejah
7fdeb8797e hardcoding bad 2022-09-23 00:26:39 -06:00
meejah
62b92585c6 simplify 2022-09-22 23:57:19 -06:00
meejah
a182a25079 backslashes 2022-09-22 21:43:20 -06:00