-
Notifications
You must be signed in to change notification settings - Fork 0
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
test vaults and reserve indexing #38
Conversation
954545d
to
c591541
Compare
d63b5ee
to
5f95b40
Compare
ef43862
to
04c2250
Compare
|
||
- name: Wait for GraphQL server | ||
run: sleep 120 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For a lesser waiting period it tends to fail:
./scripts/validateData.mjs
API URL set to: http://localhost:3000/
Entity: vaults, Block Height: 742
Error: (TypeError#1)
TypeError#1: fetch failed
at Function.captureStackTrace (file:///home/runner/work/agoric-subql/agoric-subql/node_modules/ses/src/error/tame-v8-error-constructor.js:229:9)
at node:internal/deps/undici/undici:12618:11
at async file:///home/runner/work/agoric-subql/agoric-subql/scripts/validateData.mjs:24:20
TypeError#1 cause: (SocketError#2)
Nested error under TypeError#1
SocketError#2: other side closed
at Socket.onSocketEnd (node:internal/deps/undici/undici:9169:26)
at Socket.emit (node:events:529:35)
at endReadableNT (node:internal/streams/readable:1400:12)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
At 60 seconds wait, http://localhost:3000
consistently works and test pass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Helpful to include a comment with what value you've found to be too small
Alternately, scripts/validateData.mjs
could have a "wait and retry" but this is fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rabi-siddique I agree with Turadg's wait and retry suggestion. Such hardcoded sleep times cause flakiness in future. Something like following can be done (as a follow-up)
- name: Wait for GraphQL server to be ready
run: |
echo "Waiting for GraphQL server to be ready..."
until curl -s -o /dev/null -w "%{http_code}" http://localhost:4000/graphql | grep -q "200"; do
echo "GraphQL server is not ready yet. Retrying in 5 seconds..."
sleep 5
done
echo "GraphQL server is ready!"
shell: bash
6831fd7
to
f923a69
Compare
c912d4f
to
6a69b4e
Compare
773091e
to
4ae66aa
Compare
- name: Set Execute Permission for All Scripts | ||
run: chmod +x ./scripts/*.mjs | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be done in SCM. Git maintains the execution flags.
- name: Set Execute Permission for All Scripts | |
run: chmod +x ./scripts/*.mjs |
|
||
- name: Wait for GraphQL server | ||
run: sleep 120 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Helpful to include a comment with what value you've found to be too small
Alternately, scripts/validateData.mjs
could have a "wait and retry" but this is fine
blockHeight: 1212 | ||
apiUrl: 'http://localhost:3000/' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please move these repeated env vars to the job level
bf1abec
to
acbb7ed
Compare
acbb7ed
to
ff58074
Compare
This PR automates the testing of Vault and Reserve entities using GraphQL queries to enhance flexibility in matching expected values. It also removes the test cases previously written with
@subql/testing
, which were restrictive due to issues with dates.