Skip to content

Rate Testing#1605

Closed
Zach-O-Bates wants to merge 6 commits into
OpenEnergyDashboard:developmentfrom
Zach-O-Bates:rate_testing
Closed

Rate Testing#1605
Zach-O-Bates wants to merge 6 commits into
OpenEnergyDashboard:developmentfrom
Zach-O-Bates:rate_testing

Conversation

@Zach-O-Bates

Copy link
Copy Markdown

Description

This pull request resolves issues with login rate limiting and test reliability. The login rate limiter was updated to behave differently based on environment variables, allowing normal tests to run without interference while enforcing strict limits during dedicated rate limit testing. A separate ratetest environment was introduced to properly validate 429 responses without impacting other test suites.

Fixes #1564

Type of change

(Check the ones that apply by placing an "x" instead of the space in the [ ] so it becomes [x])

  • Note merging this changes the database configuration.
  • This change requires a documentation update

Checklist

  • I have followed the OED pull request ideas
  • I have removed text in ( ) from the issue request
  • You acknowledge that every person contributing to this work has signed the OED Contributing License Agreement and each author is listed in the Description section.

Limitations

N/A

@Zach-O-Bates Zach-O-Bates changed the title Rate testing Rate Testing Apr 13, 2026
@huss

huss commented Apr 16, 2026

Copy link
Copy Markdown
Member

This is to note that PR #1593 may change the route location of the login and this could impact this PR.

OED really should check all route names to verify they are correct compared to usage here and the upcoming test code (this part is outside the scope of the PR).

@huss huss left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@Zach-O-Bates Thanks for working on this issue. Overall it is okay but I've made some comments to consider. Please let me know if anything is not clear or you have questions/thoughts.

Comment thread src/server/app.js Outdated
Comment thread src/server/tempRatetest/rateTest.js Outdated
Comment thread src/server/tempRatetest/rateTest.js Outdated
Comment thread src/server/tempRatetest/rateTest.js Outdated
Comment thread src/server/app.js Outdated
Comment thread src/server/app.js Outdated
Comment thread src/server/tempRatetest/rateTest.js Outdated
});
expect(first).to.have.status(401);

const second = await chai.request(app)

This comment was marked as duplicate.

Comment thread src/server/tempRatetest/rateTest.js Outdated
Comment thread src/server/app.js Outdated
Comment thread src/server/tempRatetest/rateTest.js Outdated

@huss huss left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@Zach-O-Bates Thank you for addressing my previous comments. I have made a couple of new ones and also commented on a couple of older ones. I think this is getting much closer. Please let me know if anything is not clear or you have thoughts/questions.

Comment thread src/server/app.js
Comment thread src/server/rateTest/rateTest.js
Comment thread src/server/tempRatetest/rateTest.js Outdated
Comment thread src/server/tempRatetest/rateTest.js Outdated
});

//First request that makes it through to authentication
expect(first).to.have.status(HTTP_CODE.UNAUTHORIZED);

This comment was marked as resolved.

Comment thread src/server/rateTest/rateTest.js
@huss

huss commented Jun 7, 2026

Copy link
Copy Markdown
Member

@Zach-O-Bates I was sweeping issues and wanted to see if you could give me any information on the status of this work. Thanks.

@huss

huss commented Jul 20, 2026

Copy link
Copy Markdown
Member

I'm noting that several outstanding issues/comments are being marked resolved/hidden because they are completed in PR #1670 but they were never done in this PR. This is helping track needed changes.

@huss

huss commented Jul 20, 2026

Copy link
Copy Markdown
Member

PR #1670 continues this work so this PR is being closed since that PR has now addressed all the open comments in this PR.

@huss huss closed this Jul 20, 2026
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.

limit login rate

2 participants