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

CI failure due to dropped trailing zero on timestamp #1835

Closed
philrz opened this issue Sep 15, 2021 · 0 comments · Fixed by #1836
Closed

CI failure due to dropped trailing zero on timestamp #1835

philrz opened this issue Sep 15, 2021 · 0 comments · Fixed by #1836
Assignees
Labels
test Creating/improving test automation

Comments

@philrz
Copy link
Contributor

philrz commented Sep 15, 2021

Since the merge of #1792, we've had intermittent failures in the Brim CI. I created a branch and triggered the CI several times and found it failed 6 out of 10 times. I think I can see the pattern of what's wrong.

The failures look like this:

FAIL app/search/flows/viewer-search.test.ts
  ● a normal response › zealot gets the request

    expect(received).toEqual(expected) // deep equality

    Expected: "from '1' | ts >= 2021-09-15T01:15:19.060Z | ts <= 1970-01-01T00:00:00.001Z | dns query | head 500"
    Received: "from '1' | ts >= 2021-09-15T01:15:19.06Z | ts <= 1970-01-01T00:00:00.001Z | dns query | head 500"

Peeking at the code at https://github.com/brimdata/brim/blob/0dcf10c452efba1de841a512b38dc1c424f01e25/app/search/flows/viewer-search.test.ts#L62 we see the from value starts life as a response from new Date(), which returns the current date and time, and hence is going to vary on each run, which explains the non-determinism. While I don't claim to understand all aspects of the test code, assuming the "Received" value is coming from the backend in some way, we can see by hitting Zed directly how it drops trailing zeros like this.

$ zq -version
Version: v0.30.0-5-g5c4868de

$ echo '{mytime: 2021-09-15T01:15:19.060Z}' | zq -
{mytime:2021-09-15T01:15:19.06Z}

I'm guessing that for the runs that succeed there's no trailing zero in the current timestamp.

@philrz philrz added the test Creating/improving test automation label Sep 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Creating/improving test automation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants