Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The method closes the file and returns a promise that will resolve to null once the operation is complete. Closing a file is a no-op in k6, as we don't have to worry about file descriptors. However, we still expose this method to the user to be consistent with the existing APIs such as Node's or Deno's. The promise will resolve to null, regardless of whether the file was previously opened or not. One of the reasons this method is currently is a no-op is that as of today (v0.46), k6 does not support opening files in the VU context. As a result, the file is always opened in the init context, and thus closed when the init context is closed. Any attempt of clever strategies attempting to limit long-lived files' content in memory (e.g reference counting the VU instances of a file, and releasing the memory once the count reaches zero) would thus be premature.
- Loading branch information