Skip to content

testing support for concurrent HTTP calls and Firestore side effects in Firebase Cloud Functions (Python, Gen 2) #249

Description

@HouseOfCode0

What I’m looking for

  • A Python testing approach or library that can help for generation 2 functions & firebase.
  • Mock/simulate multiple concurrent POST requests.
  • Assert Firestore database state after execution.
  • Something that works well the firebase local emulator.

What I have tried so far

  1. I have found testing documentation for js : https://firebase.google.com/docs/functions/unit-testing
  2. Tried testing on firebase emulator with little success since concurrency behaviour greatly differs from production:https://cloud.google.com/firestore/native/docs/emulator#transactions
  3. Unit test samples only involve js : https://github.com/firebase/functions-samples/tree/main?tab=readme-ov-file

Activity

  1. HassanBahati commented on Sep 5, 2025

    @HassanBahati
    Contributor

    Hi @HouseOfCode0 , thank you for opening this issue, we will review it and provide you with feedback. Thanks!

  2. CorieW commented on Sep 17, 2025

    @CorieW
    Member

    Not sure there are any solution for this currently, but I will raise it.

    An alternative could be testing with a test project on the Firebase platform. The free tier should probably cover this, but always be wary of billing. Test what you can using the emulator, especially ensuring no infinite recursion of triggers. For example, onDocumentUpdate('testDoc') updating document 'testDoc', causing updates forever.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions