Skip to content
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

bacpop-25 use gps v6 db #42

Merged
merged 47 commits into from
Feb 20, 2024
Merged

bacpop-25 use gps v6 db #42

merged 47 commits into from
Feb 20, 2024

Conversation

EmmaLRussell
Copy link
Collaborator

@EmmaLRussell EmmaLRussell commented Oct 10, 2023

Target beebop_py branch which uses gps v6 db, and use v6 location.

Also a few changes related to intermittent test failures (described inline) - one still seems to be an issue, but not when I'm watching... 🙈

To be reviewed in conjunction with the corresponding beebop_py branch: bacpop/beebop_py#32

@codecov-commenter
Copy link

codecov-commenter commented Jan 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (b92fb8d) 98.91% compared to head (f5159bb) 98.91%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #42   +/-   ##
=======================================
  Coverage   98.91%   98.91%           
=======================================
  Files          31       31           
  Lines         648      648           
  Branches      105      105           
=======================================
  Hits          641      641           
  Misses          7        7           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -50,7 +50,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: ./app/client/package-lock.json
cache-dependency-path: ./app/server/package-lock.json
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This path just seemed to be wrong!


const { toLocaleString } = Date.prototype;
// eslint-disable-next-line no-extend-native
// eslint-disable-next-line no-extend-native, func-names
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Disabling this rule here to remove lint warning .

@@ -43,19 +44,18 @@ describe("Error handling", () => {
testSample.projectId = projectId;
const poppunkRes = await post(`poppunk`, testSample, connectionCookie);
expect(poppunkRes.status).toBe(200);
const counter = 0;
let counter = 0;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This counter hadn't been counting!

await new Promise(resolve => {
setTimeout(() => {resolve(""), 1000})
});
await setTimeout(2000);
Copy link
Collaborator Author

@EmmaLRussell EmmaLRussell Jan 29, 2024

Choose a reason for hiding this comment

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

The previous attempt at delays between polling hadn't been working, so we were getting some intermittent test failures, which I think were related to spamming the endpoint. Bumping up the delay as well to avoid intermittent errors on first poll .

Copy link
Contributor

Choose a reason for hiding this comment

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

can we use fake timers here instead if possible?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Unfortunately not, as we're waiting for a popunk job to finish and polling the real beebop_py api.

const statusRes = await post("status", {hash: testSample.projectHash}, connectionCookie);
expect(statusRes.status).toBe(200);
// This is occasionally mysteriously flaky on CI and I haven't been able to diagnose why - surface the
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

sigh

@EmmaLRussell EmmaLRussell marked this pull request as ready for review January 30, 2024 09:59
@@ -2,7 +2,7 @@ NETWORK=beebop_nw
VOLUME=beebop-storage
NAME_REDIS=beebop-redis
NAME_API=beebop-py-api
API_BRANCH=main
API_BRANCH=bacpop-25
Copy link
Contributor

Choose a reason for hiding this comment

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

leaving comment so can be changed before merge

@absternator
Copy link
Contributor

LGTM and worked well

-v $VOLUME:/beebop/storage \
mrcide/beebop-py:$API_BRANCH rqworker
docker run -d --rm --name $NAME_API --network=$NETWORK \
--pull always \
Copy link
Collaborator

Choose a reason for hiding this comment

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

should this pull not be retained? also the --rm?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The rm should! I'll re-add that. I've moved the pull to previous docker run, which is for the same image - mrcide/beebop-py:$API_BRANCH

--env=REDIS_HOST="$NAME_REDIS" \
--env=STORAGE_LOCATION="./storage" \
--env=DB_LOCATION="./storage/GPS_v4_references" \
--env=DB_LOCATION="./storage/GPS_v6_references" \
Copy link
Collaborator

Choose a reason for hiding this comment

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

will we ever run with v4 again?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Probably not. Are you thinking we could just have a fixed storage location?

@EmmaLRussell
Copy link
Collaborator Author

This PR: #46 adds a docker quick start and includes commits from this branch too - may make it easier to test!

Comment on lines +45 to +47
const fakeProjectHash = `${projectId}ABC`;
const projectData = testSample(fakeProjectHash, projectId);
const poppunkRes = await post(`poppunk`, projectData, connectionCookie);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So I think part of the problem was that we weren't using a unique project hash every time we ran poppunk, so I've changed testSample from an object to a function, and making a new hash for each new project id...

@@ -2,5 +2,6 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
testTimeout: 120000
testTimeout: 120000,
maxWorkers: 1
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

...but I think the main issue was that the persistence tests were blitzing redis, and they were potentially running in parallel with the error tests. So limiting to sequential run here...

@EmmaLRussell EmmaLRussell merged commit 681489b into main Feb 20, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants