Skip to content

Non Default Ports Do Not work #11

@b0ot

Description

@b0ot
@samtstern @yuchenshi @rachelmyers

I know this is a bug report and I shouldn't let my frustrations bleed through, but after spending weeks trying to get a WSL fix only to be forced to downgrade to WSL 1, I was pretty frustrated that I encountered another error so quickly. It has been weeks and countless hours trying to make it through a simple codelab.

Platform: Windows Build 19042.630 w/ WSL Version 1 Ubuntu 20.04
References:
Initially I came across this issue while trying to follow Todd/Rachel's Youtube Video on Unit Security Testing
Issue 61

Description:
I did a clean setup for the emulators code lab and followed the instructions to step 8.
The only change that I had to make is that my default ports are not free, so I had to modify the firebase.json file before running the emulators

{
  "firestore": {
    "rules": "firestore.rules",
    "indexes": "firestore.indexes.json"
  },
  "functions": {
    "source": "functions"
  },
  "hosting": {
    "public": "public",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ]
  },
  "emulators": {
    "functions": {
      "port": 5002
    },
    "firestore": {
      "port": 8085
    },
    "hosting": {
      "port": 5007
    }
  }
}

During step 8 when I go to run the mocha tests I get the following error:

Error: Timeout of 5000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.

Based on my experimenting on my referenced issue, I believe that the mocha test doesn't know how to connect to the emulator on non-default ports. I had a work around for initializeTestApp, but could not find a workaround for initializeAdminApp.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions