Skip to content

Conversation

@ofrobots
Copy link
Contributor

Ref: googleapis/nodejs-logging-winston#265

  1. Synchronize the system test with logging-winston. Use the same
    structure and reliable mechanism for polling.
  2. Apply the timeout uniformly across the test.
  3. Use unique serviceContext for the error reporting tests to ensure
    concurrent executions of the tests do no race.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Feb 13, 2019
Ref: googleapis/nodejs-logging-winston#265

1. Synchronize the system test with logging-winston. Use the same
   structure and reliable mechanism for polling.
2. Apply the timeout uniformly across the test.
3. Use unique serviceContext for the error reporting tests to ensure
   concurrent executions of the tests do no race.
@JustinBeckwith JustinBeckwith added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 13, 2019
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 13, 2019
DominicKramer
DominicKramer previously approved these changes Feb 13, 2019
@DominicKramer
Copy link
Contributor

LGTM once the tests are passing.

@codecov
Copy link

codecov bot commented Feb 13, 2019

Codecov Report

Merging #261 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #261   +/-   ##
=======================================
  Coverage   91.78%   91.78%           
=======================================
  Files           2        2           
  Lines          73       73           
  Branches        6        6           
=======================================
  Hits           67       67           
  Misses          6        6

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 6665195...6e17a14. Read the comment docs.

@ofrobots
Copy link
Contributor Author

Needed to add another commit that fixes the remaining system tests. They were not running previously because of the errant describe.only in the system tests.

This should be landed with Rebase and merge rather than Squash and merge.

These tests were not even running before because of the errant
describe.only in logging-bunyan.ts fixed in the previous commit.

Fix. Deflake.
@ofrobots
Copy link
Contributor Author

This needs a re-review @googleapis/node-team.


describe('LoggingBunyan', () => {
const WRITE_CONSISTENCY_DELAY_MS = 90000;
const UUID = uuid.v4();
Copy link
Contributor

@JustinBeckwith JustinBeckwith Feb 13, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Being picky, but couldn't this all be boiled down to:

const LOG_NAME = `${uuid.v4()}-logging-bunyan-system-test`;

It looks like we have a method that only gets called once with a single string.

Copy link
Contributor Author

@ofrobots ofrobots Feb 13, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the expectation is that we can have have more tests in this file in the future. They could potentially want to use unique log names.

The pedigree of this code is that is copied from sister winston library, which indeed has multiple tests.

I can make the change if you insist, but I do not think it is necessary.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not insist :)

@JustinBeckwith JustinBeckwith merged commit 4a694d3 into master Feb 13, 2019
@ofrobots ofrobots deleted the deflake branch April 10, 2019 19:26
await delay(WRITE_CONSISTENCY_DELAY_MS);

const log = logging.log('bunyan_log');
const log = logging.log(`${LOG_NAME}_applog`);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this suffixed with _applog for middleware? For non middleware the it just uses ${LOG_NAME}. So now we have two different naming conventions for the same app's logs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is suboptimal. The reason behind this is that for request bundling to work, the 'request log stream' (the log which has the http requests) has to be a different log name than the the 'application log' (where normal user logging should go). We chose to use a suffix for the applog, but it might have been better to use a suffix for the request log (since it is not user-generated).

This will be fixed when a counterpart of this PR is ported over to this library.

Note that you will still have two different log streams.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants