go
go copied to clipboard
x/telemetry/counter/countertest: add countertest.Close
The countertest package exists to test telemetry instrumentation, with a countertest.Open(dir) API to initialize the counter file in a temp directory.
But on Windows, we can't clean up that directory while the counter file is open. I think we should add a countertest.Close() function to close the counter file.
This is non-trivial: the file mapping logic is complicated, and likely assumes that the file stays open.
@hyangah recalls that munmap / Close may not be possible on some platforms. We should investigate.