-
Notifications
You must be signed in to change notification settings - Fork 439
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tenable_io: fix flakey test and timestamp handling (#10940)
The comparison for determining whether the pagination had completed was based on the response's size and the batch size (via state.batch_size, but could also have been the response's params.size without difference in behaviour). This was not correct since the size value is the current response's result set and so may match the batch size even when the pagination is complete, in the case that total size mod batch size is zero. Instead keep a running tally of records returned throughout the pagination and compare this to the total count reported by the API. Also fix the test case so that the response matches the API docs.[1] The timestamps were being examined for their maximum by string comparison. This should approximately always work if the timestamp is formatted as RFC3339, but the timestamps are rendered as variable precision RFC3339, so make sure that the comparisons work by converting to timestamp values to obtain the maximum. [1]https://developer.tenable.com/reference/io-plugins-list
- Loading branch information
Showing
5 changed files
with
46 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters