Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test-time-0947 potentially incorrect? #7038

Open
matajoh opened this issue Sep 19, 2024 · 2 comments
Open

test-time-0947 potentially incorrect? #7038

matajoh opened this issue Sep 19, 2024 · 2 comments
Labels

Comments

@matajoh
Copy link
Contributor

matajoh commented Sep 19, 2024

When digging into tests as part of the rego-cpp implementation, I noticed that test-time-0947 appears to be testing for time caching, but as written it will always be true regardless of the caching behaviour:

        package generated

        p {
          time.now_ns(t0)
          test.sleep("10ms")
          time.now_ns(t1)
          t1 = t2
        }

It appears from the name of the test that the line t1 = t2 was probably intended to be t0 = t1. What is the intended behaviour here? I've verified that this is the same in both v0 and v1.

@matajoh matajoh added the bug label Sep 19, 2024
@srenatus
Copy link
Contributor

I think you're correct there. As it stands, that test does nothing. 😳

@anderseknert
Copy link
Member

Another case for not using the unification operator where not needed. Good catch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants