How to delete entries in teardown

In first scenario, I create entries in setup() and I am able to delete them in teardown(). In second scenario, I create entries in default function() but unable to delete them in teardown(). The variable is in init context. Is it supposed to be this way?

Yes, every VU is executed in a separate JavaScript runtime, so it has a separate init context. setup() and teardown() are also executed in different runtimes from VUs and from each other.

So currently there is no way to pass some variable from a VU to teardown(). As shown in https://k6.io/docs/using-k6/test-life-cycle, teardown(data) only receives the result of setup() as its first and only parameter - this way, if you allocate some resources in setup(), you can clean them up in teardown().

Damn it…it will be such a mess…Thanks for clarifying though