Skip to content

test: fix flaky sample test #1325

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

Merged
merged 1 commit into from
Mar 29, 2021

Conversation

laljikanjareeya
Copy link
Contributor

@laljikanjareeya laljikanjareeya commented Mar 26, 2021

It seems that if an instance is old enough, the operations' logs "disappear". Hence return undefined in the test logic.

Propose implementation:
Instead of relying on the operation, we added another label with the timestamp of instance creation and validate the age of the instance based on that label.

Another point towards this implementation is that similar logic is used in system-test clean up.

Fixes #1322

@laljikanjareeya laljikanjareeya requested review from a team as code owners March 26, 2021 03:43
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Mar 26, 2021
@product-auto-label product-auto-label bot added api: spanner Issues related to the googleapis/nodejs-spanner API. samples Issues that are directly related to samples. labels Mar 26, 2021
@codecov
Copy link

codecov bot commented Mar 26, 2021

Codecov Report

Merging #1325 (61782b6) into master (ffb88bb) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           master    #1325    +/-   ##
========================================
  Coverage   98.60%   98.60%            
========================================
  Files          23       23            
  Lines       21899    21899            
  Branches     1099     1225   +126     
========================================
  Hits        21593    21593            
  Misses        297      297            
  Partials        9        9            

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ffb88bb...61782b6. Read the comment docs.

@AVaksman
Copy link
Contributor

LGTM

@AVaksman
Copy link
Contributor

I have come across the same issue before. It seems that if an instance is old enough, the operations' logs "disappear".
Hence return undefined in the test logic.
This approach seems fine. Instead of relying on the operation, we add another label with the timestamp of instance creation and validate the age of the instance based on that label.

Another point towards this implementation is that similar logic is used in system-test clean up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the googleapis/nodejs-spanner API. cla: yes This human has signed the Contributor License Agreement. samples Issues that are directly related to samples.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Spanner: "before all" hook for "should have created an instance" failed
3 participants