Skip to content

Add performance spec tests for queries against large collections #1802

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 2 commits into from
May 20, 2019

Conversation

schmidt-sebastian
Copy link
Contributor

This PR:

  • adds a new spec tests for queries that only return a small subset of documents from a large collection
  • increases the test timeout for benchmark spec tests to 10 seconds
  • fixes two performance tests failures that likely broke when we removed held write acks

@@ -66,7 +66,7 @@ describeSpec(
fromCache: true,
hasPendingWrites: true
})
.writeAcks(`collection/${i}`, ++currentVersion)
.writeAcks(`collection/${i}`, docRemote.version.toMicroseconds())
.watchAcksFull(query, ++currentVersion, docRemote)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note that in the existing code, this watchAck will get ignored since docRemote.version here is greater than the writeAck version.

Copy link
Contributor

@mikelehen mikelehen left a comment

Choose a reason for hiding this comment

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

LGTM with nits

@@ -47,7 +49,8 @@ const KNOWN_TAGS = [
];

// TODO(mrschmidt): Make this configurable with mocha options.
const RUN_BENCHMARK_TESTS = false;
const RUN_BENCHMARK_TESTS = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

Intentionally enabling these? How long do they take?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hm. I woke up too early today.

function getTestRunner(
tags,
persistenceEnabled
): ExclusiveTestFunction | PendingTestFunction {
Copy link
Contributor

Choose a reason for hiding this comment

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

Neat.

const mode = usePersistence ? '(Persistence)' : '(Memory)';
const fullName = `${mode} ${name}`;
runner(fullName, async () => {
const testFunction = runner(fullName, async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Thoughts on renaming testFunction to queuedTest or something? I misunderstood what was going on at first.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamed

@schmidt-sebastian schmidt-sebastian merged commit 3635f53 into master May 20, 2019
@schmidt-sebastian schmidt-sebastian deleted the mrschmidt-perf branch June 10, 2019 23:14
@firebase firebase locked and limited conversation to collaborators Oct 11, 2019
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.

2 participants