Commit Graph

18 Commits

Author SHA1 Message Date
Eugene Kabanov 8156e2997a
Fix not enough memory on i386. (#467)
* Fix waitFor() should not exit earlier last callback will be scheduled.

* Tune tests to use less memory.

* Fix `testutils`. There is no more last poll() needed.

* Update chronos/internal/asyncfutures.nim

---------

Co-authored-by: Jacek Sieka <jacek@status.im>
2023-11-10 07:42:36 +01:00
Eugene Kabanov 2e8551b0d9
Cancellation fixes and tests. (#445)
* Add callTick and stream cancellation tests.

* Fix stepsAsync() test.

* Cancellation changes.

* Update and add more cancellation tests.

* Fix Posix shutdown call to handle ENOTCONN error.

* With new changes to to cancellation its now possible.

* Refactor testsoon.nim to not produce artifacts after tests are finished.

* Debugging MacOS issue.

* Adjust flaky test times.

* Fix issue.

* Add test for issue #334 which was also addressed in this PR.
Avoid `break` in problematic test.

* Add noCancelWait() call which prohibits cancellation.
Fix closeWait() calls to use noCancelWait() predicate.
Adding sleep to flaky MacOS test.

* Remove all debugging echoes.

* Fix cancelAndWait() which now could perform multiple attempts to cancel target Future (mustCancel behavior).

* Fix issues revealed by switch to different cancelAndWait().

* Address review comments.

* Fix testutils compilation warning.

* Rename callTick() to internalCallTick().

* Add some documentation comments.

* Disable flaky ratelimit test.

* Rename noCancelWait() to noCancel().
Address review comments.
2023-09-15 19:38:39 +03:00
Eugene Kabanov 300fbaaf09
HttpAddress errors should be not only critical. (#446)
* Distinguish between resolve errors and check errors.

* Fix issues and add test for getHttpAddress() procedure.

* Address review comments.
2023-09-04 21:49:45 +03:00
Eugene Kabanov 155d89450e
Trackers refactoring. (#416)
* Refactor chronos trackers to be more simple.

* Refactor trackers.
Add HTTP server trackers.
Refactor HTTP main processing loop.

* Compatibility fixes.
Add checkLeaks().

* Fix posix test issue.

* Add httpdebug module which introduces HTTP connection dumping helpers.
Add tests for it.

* Recover and deprecate old version of Trackers.

* Make public iterators to iterate over all tracker counters available.
Fix asynctests to use public iterators instead private one.
2023-07-14 13:35:08 +03:00
Eugene Kabanov 73fd1206ab
Disable HTTP/1.1 pipeline support for HTTP/S server by default. (#410)
* Disable HTTP/1.1 pipeline support for HTTP/S server by default.
Add tests.

* Fix tests according to new behavior.
Fix tests to use random assigned OS ports instead of predefined.

* Fix flaky tests in testasyncstream.
2023-06-26 16:28:33 +03:00
Jacek Sieka a6ac5f2213
exception warning fixes (#403) 2023-06-05 13:03:38 +02:00
Eugene Kabanov f748387462
Add HTTP client helper to read `text/event-stream` streaming response. (#375) 2023-05-19 17:25:22 +03:00
Eugene Kabanov 8aa8ee8822
Add flag to completely disable HTTP/1.1 pipelining support. (#387)
* Add flag for HTTP/1.1 pipeline disable.

* Switch from NoHttp11Pipeline to Http11Pipeline.
2023-05-12 17:00:37 +03:00
Eugene Kabanov 9ba418cd3b
Eliminate warnings on Windows. (#382) 2023-04-30 19:09:36 +02:00
Jacek Sieka 229de5f842
Compile-time configuration (#371)
This PR moves all compile-time configuration to a single module,
simplifying documentation and access to these features.

Upcomfing features may be enabled either individually, or through a new
`chronosPreviewV4` catch-all designed to allow code to be prepared for
increased strictness in future chronos releases.

`-d:chronosDebug` may be used to enable the existing debugging helpers
together.
2023-03-31 07:35:04 +02:00
Eugene Kabanov 0688d2ef8f
Add idle connection timeouts for HTTP client's connections pool. (#324)
* Add idle connection timeouts for HTTP client's connections pool.
Add timestamps and duration for both HTTP client requests/responses.
Add test.

* Add comments on `connectionFlag` decisions.

* Address review comments.
Adjust default idle connection timeout to 60 seconds.

* Increase timeout for test.

* Adjust timeout to lower value.

* Address review comments.
2023-03-21 15:10:35 +02:00
Eugene Kabanov 8fcbe716b2
Add more verbose information about failure in basic auth test. (#351) 2023-01-24 01:48:31 +02:00
Eugene Kabanov 266e2c0ed2
HTTP client: Allow request connection management. (#323)
* Allow per-request connection management.
Fix NewConnectionAlways leak issue.

* Address review comment.
2022-10-13 10:18:13 +00:00
Eugene Kabanov 79c51914ae
Fix jigsaw test. (#301) 2022-07-30 23:16:30 +03:00
Tanguy 3621143c89
reenable auth test with other server 2022-03-30 17:09:43 +02:00
Tanguy 0bd9238409
Skip failing test to restore CI 2022-03-30 16:56:04 +02:00
Eugene Kabanov 15137f71c3
Basic authorization implementation for HTTP client. (#204)
* Basic authorization implementation for HTTP client.
Add tests for basic authorization.

* Bump chronos version to 3.0.5.
2021-06-29 02:38:08 +03:00
Eugene Kabanov be184a815c
Httpclient (#182)
* Initial commit.

* Some refactoring.

* Allow boundstream to accept uint64.
Fix httpserver and asyncstream tests to follow new uint64 requirement.

* send() and getBodyBytes() implementations.

* Add closeWait for response and request.
Refactor finish/close flow.

* Changes in state machine
Add first test.

* Missing test file.

* Fixed tests
Add http leaking trackers and tests.

* Some fixes in multipart.
Fix automatic Content-Length header for requests with body.
Fix getBodyBytes() assertions.
Merging tests to main suite.

* Post rebase fixes.

* Fix tests big message generation.

* Fix response state management and leaks for getBodyXXX() procedures.

* Add redirection support to client and server.
Add fetch(url) procedure with redirection support.
Add tests for redirection.
2021-05-10 10:26:36 +03:00