DiskUsageMonitor never fails with a non existing disk
Description
DiskUsageMonitor.poll() never fails a service poll with the "could not find {diskName} in table" status any more.
If we are able to walk hrStorageTableDescr, and get no results, it will return a PollStatus.unavailable();
Then during the iteration through they entryset of results, we flip foundDisk to true, after which since foundDisk is true, we return the status object which was set to PollStatus.available().
So if you had a poll for disk /data, and it wasn't found in the hrStorageDescr columns, it would be marked as available even though it doesn't exist!
DiskUsageMonitor needs a unit test built for it to test all these logic paths.
Acceptance / Success Criteria
None
Lucidchart Diagrams
Activity
Show:
Jesse White March 26, 2015 at 3:52 PM
Fix reverted, and pull request merged.
Jesse White March 26, 2015 at 3:40 PM
Nice catch. I wasn't aware there was already a pull request for this.
DiskUsageMonitor.poll() never fails a service poll with the "could not find {diskName} in table" status any more.
If we are able to walk hrStorageTableDescr, and get no results, it will return a PollStatus.unavailable();
Then during the iteration through they entryset of results, we flip foundDisk to true, after which since foundDisk is true, we return the status object which was set to PollStatus.available().
So if you had a poll for disk /data, and it wasn't found in the hrStorageDescr columns, it would be marked as available even though it doesn't exist!
DiskUsageMonitor needs a unit test built for it to test all these logic paths.