mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 18:02:05 +00:00
* 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
27 lines
550 B
Nim
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()
|