Skip to content

tests: Fix test flake from timestamp sanitization#2713

Merged
phanimarupaka merged 2 commits intokptdev:mainfrom
justinsb:fixup_test_flake
Feb 4, 2022
Merged

tests: Fix test flake from timestamp sanitization#2713
phanimarupaka merged 2 commits intokptdev:mainfrom
justinsb:fixup_test_flake

Conversation

@justinsb
Copy link
Copy Markdown
Contributor

@justinsb justinsb commented Feb 2, 2022

When timestamps "overlap", sanitization did not work correctly.

This logic is only used in the tests.

For example:

in 1s ... in 2.1s

We find two substitution: 1s and 2.1s.

The first substitution would replace 1s => 0s

in 0s ... in 2.0s

The second substitution is predetermined, and replaces 2.1s => 0s, but 2.1s is no longer in the string.

When timestamps "overlap", sanitization did not work correctly.

For example:

in 1s ... in 2.1s

The first substitution would replace 1s => 0s

in 0s ... in 2.0s

The second substitution is predetermined, and replaces 2.1s => 0s, but
2.1s is no longer in the string.
@justinsb justinsb requested a review from droot February 3, 2022 02:00
@phanimarupaka phanimarupaka merged commit 7ee57d6 into kptdev:main Feb 4, 2022
This was referenced Feb 4, 2022
martinmaly added a commit that referenced this pull request Feb 4, 2022
* Fix test flake from timestamp sanitization

When timestamps "overlap", sanitization did not work correctly.

For example:

in 1s ... in 2.1s

The first substitution would replace 1s => 0s

in 0s ... in 2.0s

The second substitution is predetermined, and replaces 2.1s => 0s, but
2.1s is no longer in the string.

* Use new sanitization function in tests, remove old function

Co-authored-by: Justin Santa Barbara <justinsb@google.com>
@martinmaly martinmaly mentioned this pull request Feb 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants