Open skorfmann opened 6 months ago
IMO this isn't a bug -- if we waited for async processes to finish, then tests ran locally would behave differently from running tests on the cloud. I'm also not sure if there's a reliable way to wait for all ongoing compute to finish on AWS (see e.g. https://stackoverflow.com/questions/53311165/is-there-a-way-to-programmatically-know-how-many-concurrent-instances-of-a-lambd) or other clouds.
Of course, we could try to make this more transparent in the simulator. For example, maybe we could hint that there was still ongoing work:
$ wing test main.w
pass ─ main.wsim » root/env0/test:test (2 non-idle resources)
Tests 1 passed (1)
Test Files 1 passed (1)
Duration 0m0.54s
what do you think @skorfmann?
@Chriscbr yes, I like that idea 👍 Would be pretty interesting which resources. Would be looking for an easy way to dig deeper as a user.
I tried this:
just realized that the cloud.Topic is a bit tricky within tests. If there's no blocking waiter somewhere, the tests might finish before messages were processed. Makes sense when thinking about it, it's still pretty confusing when the console works as expected since it just keeps running forever and tests are not.
playground
This happened:
the logs are not showing up, since the test is finished and exits
I expected this:
some way to force waiting
Is there a workaround?
add a waiter
playground
Anything else?
even if fixed on sim, this might be still confusing on cloud targets.
https://winglang.slack.com/archives/C048QCN2XLJ/p1703151191040499
Wing Version
0.53.4
Node.js Version
18.7
Platform(s)
MacOS
Community Notes