You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
template asyncTest*(name: string, body: untyped): untyped =
test name:
waitFor(
(
proc() {.async.} =
body
)()
)
How to Reproduce:
Add the below test in file tests/pubsub/testgossipinternal.nim and then run any of them nim c -r tests/pubsub/testgossipinternal.nim "handle multiple SUBSCRIBE and UNSUBSCRIBE events"
Error Log:
This will crash with log below and when you do the same thing in the new file by adding the same test in the new file and running it works fine without any error.
This issue can happen when there are too many nested templates or when the compiler can't efficiently manage deep template instantiations.
Current template: tests/asyncunit.nim
import unittest2, chronos
export unittest2, chronos
template asyncTeardown*(body: untyped): untyped =
teardown:
waitFor(
(
proc() {.async.} =
body
)()
)
template asyncSetup*(body: untyped): untyped =
setup:
waitFor(
(
proc() {.async.} =
body
)()
)
template asyncTest*(name: string, body: untyped): untyped =
test name:
waitFor(
(
proc() {.async.} =
body
)()
)
How to Reproduce:
Add the below test in file
tests/pubsub/testgossipinternal.nim
and then run any of themnim c -r tests/pubsub/testgossipinternal.nim "handle multiple SUBSCRIBE and UNSUBSCRIBE events"
Test file attached.
message.txt
Error Log:
This will crash with log below and when you do the same thing in the new file by adding the same test in the new file and running it works fine without any error.
error.log
The text was updated successfully, but these errors were encountered: