Commit Graph

209 Commits

Author SHA1 Message Date
narimiran
e05daba73e try to fix the flaky test, similarly to the devel version 2021-08-25 08:22:51 +02:00
Ștefan Talpalaru
76560576d2 asyncdispatch+stackTraceOverride: fix premature collection (#18039) [backport:1.2]
Copying StackTraceEntry instances when nimStackTraceOverride is defined
breaks the link between a cstring field that's supposed to point at
another string field in the same object.

Sometimes, the original object is garbage collected, that memory region
reused for storing other strings, so when the StackTraceEntry copy tries
to use its cstring pointer to construct a traceback message, it accesses
unrelated strings.

This only happens for async tracebacks and this patch prevents that by
making sure we only use the string fields when nimStackTraceOverride is
defined.

Async tracebacks also beautified slightly by getting rid of an extra line
that was supposed to be commented out, along with the corresponding debugging output.

There's also a micro-optimisation to avoid concatenating two strings just
to get their combined length.

(cherry picked from commit a1c82c39af)
2021-05-19 19:52:50 +02:00
Timothee Cour
6dde797752 fix #13166 tioselectors flaky test on freebsd+OSX (#14634)
(cherry picked from commit d149823019)
2021-05-17 22:26:45 +02:00
flywind
a27459fc08 fix #9695 asyncmacro: tfuturevar fails when activated [backport: 1.0] (#16090)
* fix asyncmacro

* Apply suggestions from code review

* Update lib/pure/asyncmacro.nim

(cherry picked from commit 6f1a72069a)
2020-11-25 12:59:01 +01:00
Andreas Rumpf
da03b5ca8b closureiters: fixes #15243 (#15454) [backport:1.2]
* fixes #15243 [backport:1.2]

(cherry picked from commit aa1d7fe1e9)
2020-10-06 08:48:44 +02:00
Dominik Picheta
ddcbc1a58f [Backport] Fixes callbacks being dropped on Linux/macOS/BSD. (#15012)
Fixes #15003.

This is a serious bug which occurs when data cannot be read/sent
immediately and there are a bunch of other read/write events
pending. What happens is that the new events are dropped which
results in the case of the reported bug resulted in some data not
being sent (!).

(cherry picked from commit 1e3a0ef1e1)
2020-07-21 15:46:41 +02:00
Clyybber
078df45e99 Fix #13889 with testcase (#13896) [backport]
* Fix https://github.com/nim-lang/Nim/issues/13889

* Add testcase

* Reduce test time

Co-authored-by: Elie Zedeck RANDRIAMIANDRIRAY <elie.zedeck@gmail.com>
(cherry picked from commit 92c4aad205)
2020-04-14 07:30:06 +02:00
Miran
8088633250 faster CIs (#13803)
* ttables: smaller table, 5x speedup

* thavlak: less iterations, less loops; 30% speedup

* tasyncclosestall: shorter timeout; 35% speedup

* gcleak4: less iterations, 2x speedup

* ttimes: remove deprecated stuff

* tdangerisrelease: remove cpp backend, 3x speedup

* tfrexp1: smaller range, 2x speedup

* trtree: fix warnings, less iterations, 6x speedup

* tasyncawait_cyclebreaker: smaller swarm size; 2x speedup

* trealloc: smaller number of iterations; 10x speedup

* towned_binary_tree: less iterations, 4x speedup

* tclosure: remove unused code, less iterations; 2x speedup

* twaitany: less durations; 1.4x speedup

* tasync_misc: less iterations, 2x speedup

* t8535: smaller sleep, 1.5x speedup

* tmanyjoin: smaller sleep, 2x speedup

* t12221: shorter sleeps, removed two slower tests; 1.6x speedup

* tfuturestream: smaller sleep; 1.5x speedup

* growobjcrash: less iterations; 2x speedup

* ttryrecv: smaller sleep; 1.5x speedup

* treusetvar: less threads; 2x speedup

* delete tthreadanalysis2, basically a duplicate of tthreadanalysis

* t7758: less iterations, 1.5x speedup

* tasyncawait: smaller swarm, less messages; 1.5x speedup

* tjsandnativeasync: smaller sleep, 1.5x speedup

* tpendingcheck: smaller sleep, 1.5x speedup

* remove rodfiles test category

* move tseq from its own category to 'collections' category

* remove unneeded tests and helpers from 'assert' category

* stdlib: merge tbitops2 into tbitops

* remove 'trepr2' from 'stdlib' cat

* merge 'tstreams' into one file

* remove 'tinefficient_const_table' from 'ccbugs' cat

* merge 'tcollections_to_string' into 'tcollections'

* tblocking_channel: smaller sleep, small speedup

* tconvexhull: less iterartions; 1.2x speedup

* merge 'tdeepcopy2' into 'tdeepcopy'

* merge 'tdisjoint_slice2' into 'tdisjoint_slice1'

* tmissing_deepcopy: smaller sequence

* tsendtwice: smaller arrays; 5x speedup

* remove 'tindexerrorformatbounds'

* disable multimethod tests

* remove 'gc:none' and 'refc' without 'd:useRealtimeGC' from gc tests

* koch.nim: bootstrap just with '-d:release', no need for 'csource'

* add github workflow for documentation

* testament: no need for 8 sub-second decimals
2020-03-30 13:18:12 +02:00
Miran
5b55aa52d0 fix deprecations and other warnings (#13748) 2020-03-25 19:15:34 +01:00
Timothee Cour
e041c184d2 fix #12919 tasyncclosestall flaky: Address already in use (#12934) 2019-12-19 18:50:39 +01:00
Miran
879801c639 increase the timeout for 'tasyncclosestall' (#12744)
This test is very flaky, this change might help reducing the
number of failings (usually solved by restarting the test suite).

Refs https://github.com/nim-lang/Nim/pull/12694#issuecomment-557583790
2019-11-26 14:12:15 +01:00
Andreas Rumpf
3ba3307d61 remove deprecated procs (#12535) 2019-11-05 11:05:46 +01:00
Andreas Rumpf
c52a2c3ab0 proof that refcounting can handle Nim's async (#12533) 2019-10-28 16:13:38 +01:00
Dominik Picheta
92fa7e0579 Merge branch 'devel' into IOSelector_unregister_fix 2019-10-22 11:31:38 -07:00
Yuriy Glukhov
1aed455e7c Fixed yield in nkCheckedFieldExpr (#12429) [backport] 2019-10-15 09:16:06 +02:00
Ray Imber
b347490f91 lowered the number of events in the test because some CI's have an extremely low FD limit 2019-10-07 10:07:05 -07:00
Ray Imber
adc1419499 Test + fix for epoll and kqueue selector modules to properly unregister
event handles that have the key type "User"
2019-10-06 16:02:12 -07:00
Leorize
73c8391fd3 azure: disable failing tests 2019-10-03 18:36:18 +02:00
Federico Ceratto
39290cf88c Fix spellings (#12277) [backport] 2019-09-27 07:02:54 +02:00
PMunch
2565d3d102 Fix issue with long wait for passed timer [bugfix] (#12221)
* Fix issue with long wait for passed timer [bugfix]

This fixes a small issue where a timer that had been completed while
code executed would still wait for more events before being considered
completed. This would in some scenarios incur a 500ms delay to the
completion of a timer.

* Refactor logic into

* Add test case based on original issue

* Use longer timeouts to be more lenient in checking

* Revert to short timeouts, but widen the accepted range

* Widen accepted range further, it is meant to check for a 500ms delay after all

* Increase poll timeout to make it easier to detect mistakes
2019-09-22 07:24:14 +02:00
Araq
908b553215 asyndispatch: removed deprecated setEvent proc 2019-09-21 06:43:37 +02:00
Arne Döring
afbcd1b330 int128 on firstOrd, lastOrd and lengthOrd (#11701)
* fixes #11847
2019-08-07 15:53:16 +02:00
Andreas Rumpf
ac458448d8 make async tests green again 2019-07-11 11:09:10 +02:00
Araq
b2f9447896 make tests green again 2019-07-10 23:32:04 +02:00
Andreas Rumpf
02b9af2f75 ABI fixes for OSX/BSD; fixes #6860 (#11666) 2019-07-06 13:00:29 +02:00
Dominik Picheta
73c44c6e9b [bugfix] Fixes async IO operations stalling even after socket is closed. (#11232) 2019-06-12 17:07:05 +02:00
Miran
50d1a46537 better docs: osproc (#10708)
* better docs: osproc
* fix a typo in the docs, deprecate "demon"
2019-02-19 17:25:03 +01:00
Federico Ceratto
d8ff25f032 Provide access to getsockname()/getpeername()
Port of #3323 with added tests
2019-02-17 17:04:57 +00:00
Miran
0ebfcd4c0f Remove deprecated modules (asyncio, sockets, ftpclient) (#10401) 2019-01-22 16:06:44 +01:00
Miran
214f48eae9 Remove long deprecated stuff (#10332) 2019-01-18 07:18:32 +01:00
Neelesh Chandola
e77dd683eb Fix defer not not-working at top level (#10191) 2019-01-07 00:51:17 +01:00
Araq
4a6d699bc5 C++: make async tests green on Windows 2018-12-21 22:03:41 +01:00
Arne Döring
a5ecbf823f lots of small changes 2018-12-11 21:23:22 +01:00
Arne Döring
2a4c09ff88 megatest can be executed 2018-12-11 21:23:21 +01:00
Arne Döring
1105d03644 require errormsg to be specified before file. 2018-12-11 21:23:21 +01:00
Arne Döring
e012eb1001 updated tests to be executed 2018-11-23 11:58:28 +01:00
Arne Döring
031bfdec6f make run the default action of a test in tester 2018-11-23 11:58:28 +01:00
Dominik Picheta
d89c815c41 Disable tasyncssl on Windows to fix CI
Workarounds #9689
2018-11-13 21:14:57 +00:00
Dominik Picheta
679a52f53c Merge pull request #9687 from narimiran/fix-7192
export `asyncdispatch.callSoon` (fixes #7192)
2018-11-13 21:12:19 +00:00
narimiran
c2b16b46ec export asyncdispatch.callSoon (fixes #7192) 2018-11-12 15:40:33 +01:00
Miran
964b5dac7c complete future only once in or (fixes #8982) (#9632)
* complete future only once in `or`

Analogous to `and`.
Credits to @k0zmo for proposing the solution.

* add test
2018-11-09 22:45:17 +00:00
narimiran
15c66a06f9 keep the order of the callbacks 2018-11-07 15:22:02 +01:00
Miran
95504caa31 make some tests faster (#9413)
* remove duplicated slow test

* smaller `convex hull`

* smaller sleep

* faster `trtree`

* smaller sleep in `tfuturestream`
2018-10-17 19:46:42 +02:00
xzfc
8ed3dac1dc Fix tests on NixOS (#9209) (#9285)
* Replace `/bin/sleep` with just `sleep`, i.e. use environment variable
  `$PATH` to locate binary.
* Replace `/usr/share/zoneinfo` with `$TZDIR` when it is defined,
  fallback to hardcoded path otherwise. This is the same behavior that
  Glibc2 normally have, see man 3 tzset.
2018-10-10 22:47:08 +02:00
Dominik Picheta
21ecf64d24 Fixes #8994. FutureStream read procedure data loss no longer occurs. (#9183)
* Fixes #8994. FutureStream read procedure data loss no longer occurs.

* Optimises the fix for #8994.
2018-10-09 19:39:12 +02:00
alaviss
2a31f42d35 asyncmacro: add nnkSym support for getName() (#9204)
Fixes #9201
2018-10-09 15:53:13 +02:00
LemonBoy
2c0bfb34fd Fix regression w/ templates defined in async proc 2018-10-03 18:25:25 +02:00
Timothee Cour
f59ddb7007 remove test_async.txt after test to keep git status clean 2018-09-29 16:57:56 +02:00
LemonBoy
75a981cf80 Skip nested procedures in .async. macro
Fixes #3075
2018-09-22 17:30:17 +02:00
LemonBoy
a27429304e Convert *_family fields to cushort
Fixes #9008
2018-09-19 12:33:11 +02:00