()
| 16 | } |
| 17 | |
| 18 | async function testGetAll() { |
| 19 | for (let i = 0; i < 55; i++) { |
| 20 | await Tasks.schedule("get_many", new Date(Date.now() + 1000000), { key: "" + i }); |
| 21 | await Tasks.schedule("get_many2", new Date(Date.now() + 1000000), { key: "" + i }); |
| 22 | } |
| 23 | |
| 24 | const inNamespace = await countAll("get_many"); |
| 25 | if (inNamespace !== 55) { |
| 26 | throw new Error(`${inNamespace} !== 55`) |
| 27 | } |
| 28 | |
| 29 | const all = await countAll(); |
| 30 | // other scripts are running, so we we have no idea how many there is overall, but it should be atleast 200 |
| 31 | if (all < 110) { |
| 32 | throw new Error(`${inNamespace} < 110`) |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | async function countAll(namespace?: string): Promise<number> { |
| 37 | let last = 0; |
no test coverage detected