Files
Nim/tests/arc/tasyncorc.nim
n5m 436e1fa5b1 fix #15631 (#15632)
* trigger valgrind failure on memory leak

* remove non-malloc tests

* remove ORC test

is redundant because we already have an ARC test

* only run valgrind tests on 64-bit Linux

* disable freebsd and openbsd

* Remove tleak_refc

As to not test implementation details (or bug)

* Fix test failures by removing redundant test

Since this tests/shoulfail/tvalgrind.nim was specified here to fail this test
itself fails since it will be skipped on non-linux CI

* Remove test, reason detailed in the previous commit

* Remove redundant disables

* Revert removing disables

* Add and use valgrind: leaks

* Fix

Co-authored-by: Clyybber <darkmine956@gmail.com>
Co-authored-by: n5m
2020-10-19 22:25:43 +02:00

27 lines
550 B
Nim

discard """
output: '''230000'''
cmd: '''nim c --gc:orc -d:useMalloc $file'''
valgrind: "leaks"
"""
# bug #14402
import asynchttpserver, asyncdispatch, httpclient, strutils
proc cb(req: Request) {.async, gcsafe.} =
const html = " ".repeat(230000)
await req.respond(Http200, html)
var server = newAsyncHttpServer()
asyncCheck server.serve(Port(8080), cb)
proc test {.async.} =
var
client = newAsyncHttpClient()
resp = await client.get("http://localhost:8080")
let x = (await resp.body).len
echo x # crash
waitFor test()