[Status] Organize metrics stuff into metrics_collector, tests into __test__ directories, remove mock-fs for the cgroup test#17788
Conversation
💚 Build Succeeded |
| readCPUAcctUsage(cpuAcctPath).catch(rejectUnlessFileNotFound), | ||
| readCPUFsPeriod(cpuPath).catch(rejectUnlessFileNotFound), | ||
| readCPUFsQuota(cpuPath).catch(rejectUnlessFileNotFound), | ||
| readCPUStat(cpuPath).catch(rejectUnlessFileNotFound) |
There was a problem hiding this comment.
@tylersmalley I could use advice here - can we chat about this?
Without these changes, I was getting unhandled rejection warnings. They weren't causing the tests to fail, but they were pretty messy. Not sure what I've changed that makes the warnings quiet down after putting the catches up here.
There was a problem hiding this comment.
I just went ahead and undid this because I don't want to hack the code to get it to not complain about my mock module.
I still would really like to understand why the unhandled rejections are happening. This code is exactly like https://runkit.com/miu/5ad8d36c36503a0012574310
💚 Build Succeeded |
|
Currently there are unhandled exception thrown in Appreciate any advice here, or LMK if this can be ignored. |
💔 Build Failed |
jenkins test this |
💚 Build Succeeded |
…_test__ directories, remove mock-fs for the cgroup test (elastic#17788) * [Status] Organize tests into __test__ directories * custom mock for fs in cgroups test * work around unhandled rejection errors * simplify fserror construct * put fs readFile mockImpl in beforeAll for pretty * undo hacking the code to suppress unhandled promise rejections * test files back to sibling of the module
…_test__ directories, remove mock-fs for the cgroup test (#17788) (#18578) * [Status] Organize tests into __test__ directories * custom mock for fs in cgroups test * work around unhandled rejection errors * simplify fserror construct * put fs readFile mockImpl in beforeAll for pretty * undo hacking the code to suppress unhandled promise rejections * test files back to sibling of the module
This is a standalone PR to make #17773 more of an atomic PR.
Replacing
mock-fswith a custom inline Jest mock is necessary because the next PR will mockos, and that was causing conflicts withmock-fs.