Skip to content

Fix Saucelabs tests for Firestore unit tests except IE #3095

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 9 commits into from
May 29, 2020

Conversation

hsubox76
Copy link
Contributor

Fix 1 error in Firefox + Safari and 2 errors in Safari only.

IE is excluded, to be fixed in a future PR, because:

  1. it has 52 errors
  2. It requires Babel compilation which causes OOM because it runs on the entire bundle of test files. This can be fixed by not using the bootstrap test bundle and just listing file globs in karma.conf.js the normal way. This may be a little less performant (https://github.com/webpack-contrib/karma-webpack#alternative-usage) but need to test out. In the meantime, since we are postponing IE as a large task, why not skip Babel compilation temporarily.

TODO: Next step is to try to run integration/firestore tests instead of integration tests in package/firestore. It is almost ready to run, but has 1 error common across all browsers, 1 exclusive to Firefox, and 12/13 in IE (memory/persistence).

@google-oss-bot
Copy link
Contributor

google-oss-bot commented May 20, 2020

Binary Size Report

Affected SDKs

  • @firebase/firestore

    Type Base (babdcfd) Head (31bf6be) Diff
    browser 251 kB 252 kB +139 B (+0.1%)
    esm2017 195 kB 195 kB +147 B (+0.1%)
    main 493 kB 494 kB +395 B (+0.1%)
    module 249 kB 249 kB +139 B (+0.1%)
  • @firebase/firestore/memory

    Type Base (babdcfd) Head (31bf6be) Diff
    browser 192 kB 192 kB +175 B (+0.1%)
    esm2017 149 kB 149 kB +161 B (+0.1%)
    main 369 kB 370 kB +435 B (+0.1%)
    module 190 kB 190 kB +175 B (+0.1%)
  • @firebase/installations

    Type Base (babdcfd) Head (31bf6be) Diff
    esm2017 16.5 kB 16.5 kB +1 B (+0.0%)
    main 22.0 kB 22.0 kB +1 B (+0.0%)
    module 21.5 kB 21.5 kB +1 B (+0.0%)
  • @firebase/util

    Type Base (babdcfd) Head (31bf6be) Diff
    browser 19.5 kB 19.6 kB +143 B (+0.7%)
    esm2017 17.4 kB 17.5 kB +126 B (+0.7%)
    main 19.5 kB 19.6 kB +143 B (+0.7%)
    module 18.6 kB 18.7 kB +126 B (+0.7%)
  • firebase

    Type Base (babdcfd) Head (31bf6be) Diff
    firebase-analytics.js 26.5 kB 26.5 kB +1 B (+0.0%)
    firebase-firestore.js 290 kB 290 kB +129 B (+0.0%)
    firebase-firestore.memory.js 232 kB 232 kB +165 B (+0.1%)
    firebase-installations.js 19.2 kB 19.2 kB +1 B (+0.0%)
    firebase-messaging.js 39.1 kB 39.1 kB +1 B (+0.0%)
    firebase-performance-standalone.es2017.js 71.9 kB 71.9 kB +3 B (+0.0%)
    firebase-performance-standalone.js 47.4 kB 47.4 kB +2 B (+0.0%)
    firebase-performance.js 37.7 kB 37.7 kB +1 B (+0.0%)
    firebase-remote-config.js 36.9 kB 36.9 kB +1 B (+0.0%)
    firebase.js 823 kB 823 kB +131 B (+0.0%)

Test Logs

@@ -143,7 +143,8 @@ describe('AsyncQueue', () => {
const doStep = (n: number): Promise<number> =>
defer(() => completedSteps.push(n));
queue.enqueueAndForget(() => doStep(1));
const last = queue.enqueueAfterDelay(timerId1, 5, () => doStep(4));
// Flaky on Safari, increasing delay to 1000ms to try to increase reliability.
const last = queue.enqueueAfterDelay(timerId1, 1000, () => doStep(4));
Copy link
Contributor

Choose a reason for hiding this comment

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

This is too long - we cannot wait a full second for a single test. Can we skip this test in Safari?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, adding a check.

@hsubox76 hsubox76 force-pushed the ch-firestore-sl2 branch from 6d6cb21 to a288e8c Compare May 21, 2020 23:15
@@ -272,11 +273,11 @@ export class TestPlatform implements Platform {
}
}

/** Returns true if we are running under Node. */
export function isNode(): boolean {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seems like this wasn't being used anywhere, and there's a better version in @firebase/util so I hope it's okay to remove?

Copy link
Contributor

Choose a reason for hiding this comment

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

@wu-hui might have just started using this. He would probably be delighted to switch to the better version :)

@@ -137,7 +138,9 @@ describe('AsyncQueue', () => {
});
});

it('can schedule ops in the future', async () => {
// Flaky on Safari.
Copy link
Member

Choose a reason for hiding this comment

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

Do we know why it is flaky on Safari?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I haven't been able to find any reason. The test relies on two setTimeouts at 1ms and 5ms happening in the correct order, and sometimes Safari doesn't seem to get the order right. I can't find any known bug or issue that might cause that.

@hsubox76 hsubox76 merged commit f2dd5c0 into master May 29, 2020
@hsubox76 hsubox76 deleted the ch-firestore-sl2 branch June 18, 2020 21:09
@firebase firebase locked and limited conversation to collaborators Jun 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants