-
Notifications
You must be signed in to change notification settings - Fork 102
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: Fix logger for export import test #1144
Merged
danieljbruce
merged 23 commits into
googleapis:main
from
danieljbruce:fix-logger-for-export-import-test
Jan 9, 2024
Merged
test: Fix logger for export import test #1144
danieljbruce
merged 23 commits into
googleapis:main
from
danieljbruce:fix-logger-for-export-import-test
Jan 9, 2024
Conversation
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
Console logs should report how far the program made it.
The current test fails silently on test.currentRetry(). What we should do instead is store the current attempt on the mocha test.
The setup for delay function creates a setup for the mocha test to use the delay function. A test is added to make sure that the delay function works properly.
Some logging is in place that does not need to be there which was useful when debugging the problem. This logging should be removed and the only function should be removed.
The console logs from the import/export test should be removed so that the test doesn’t emit any logs as before.
Remove a log that was leftover from doing testing
any should not be used if we can avoid it. string type needs to be used for the argument of the function.
bhshkh
reviewed
Sep 7, 2023
system-test/datastore.ts
Outdated
|
||
it('should be sure that the delay function emits console info messages', async function () { | ||
// Override console.info to track the number of times it is called. | ||
console.info = consoleInfoFunction; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this required if the next line is overriding this assignment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this was a typo which needs to be removed.
console log does not need to be assigned twice in a row. This is a typo from what was there before.
only should not be used in the system tests
bhshkh
approved these changes
Sep 7, 2023
…into fix-logger-for-export-import-test # Conflicts: # system-test/datastore.ts
…into fix-logger-for-export-import-test
…m/danieljbruce/nodejs-datastore into fix-logger-for-export-import-test
This test shouldn’t be flakey. It should always pass. We want to correct the race condition in this test.
Reset the log count to account for parameterized tests so that the log count is always set to 0 when it starts a new set of tests.
Now that the less than or equal to sign has been introduced, the assertion check must be modified accordingly to account for the actual number of times the test runs.
The shared context variable on mocha tests is being shared between tests and causing unexpected results. We should use a local variable instead as it seems to work the same way, but is much simpler to understand.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
api: datastore
Issues related to the googleapis/nodejs-datastore API.
size: m
Pull request size is medium.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The change involves the following:
Fixes #1143
The console.info logs will further help diagnose flakey tests in #1122