-
-
Notifications
You must be signed in to change notification settings - Fork 625
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
🐛 streaming reads should emit the dataset number for each dataset #2496
🐛 streaming reads should emit the dataset number for each dataset #2496
Conversation
Thanks @fluffynuts, 🙋🏻♂️ By including your test into Then, it's not necessary to add the To test a specific file, you can use the FILTER=test-multi-result-streaming npm run test Also, to keep good practices, there are some small suggestions:
const { createConnection } = require('../common.test.cjs');
(async function() {
'use strict';
const { assert } = require('poku');
// ...
'use strict';
const { assert } = require('poku');
const { createConnection } = require('../common.test.cjs');
(async () => {
// ... |
thanks @wellwelwel I didn't know how to filter poku tests (this is the first time I've seen poku, tbh), so that was supposed to be a temporary npm script until I had a passing test (but it turned out I could run through webstorm anyway, so...) - anyways, it's removed and the requested changes have been made |
You need to name your test file as - test/integration/test-multi-result-streaming.cjs
+ test/integration/test-multi-result-streaming.test.cjs |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2496 +/- ##
=======================================
Coverage 90.32% 90.32%
=======================================
Files 71 71
Lines 15727 15727
Branches 1339 1340 +1
=======================================
Hits 14206 14206
Misses 1521 1521
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@fluffynuts, for some reason the
Can you check it? You can also test it by using the native Node.js command: node test/integration/test-multi-result-streaming.test.cjs I don't think that it's related to this issue, but you don't need to - try {
assert.equal(captured1.length, 1);
assert.equal(captured2.length, 1);
assert.deepEqual(captured1[0], compare1[0][0]);
assert.deepEqual(captured2[0], compare2[0][0]);
- process.exit(0);
- } catch (e) {
- console.error(e);
- process.exit(1);
- } 🙋🏻♂️ |
About the lint error, you can just run |
@wellwelwel I've finally found a fail (sorry, it's right at the end, and searching for my test name was coming up blank) I've literally just run this test more than 100x without issue, so perhaps it's specific to node 21 and / or something else. I'll investigate, but I see a lot of errors like I also notice that the errors only occur with node >= 20 and SSL disabled for mysql 8.0.33, with errors about packets. I'm wondering if there's an SSL-related issue in there somewhere. Edit: using mysql 8.0.35 on windows doesn't repro the issue at all, with node 20 or 21. |
I don't believe that it's related to a specific Node and MySQL version. This really does seem to happen at random. About the "Warning: got packets...", it's not causing the error 🙋🏻♂️ assert.deepEqual(captured2[0], compare2[0][0]); Also, you don't need to force the process exit code 🙋🏻♂️ - process.exit(0);
I can try to do some debugging at the weekend, but in any case I've added a |
Hey @fluffynuts, there's a CI exclusive for MySQL versions: node-mysql2/.github/workflows/ci-mysql.yml Lines 21 to 28 in fdbed91
In that case, we already use the |
4ea147a
to
dfd19e8
Compare
@fluffynuts, you can submit a PR to your fork to test independently, it will enable all the CI for pull request events in your own fork 🧙🏻 |
I've now run this test around 400x with and without TLS on an unbuntu 22.04.4 machine with mysql 8.0.36 (just installed) - no errors. I'm going to try bumping the mysql version in the github action file.
cool, but that's not the fixture that's failing - linux-ci is failing on version 8.0.33. I've tried upping that to 8.0.36, and I get more failures (node 14 as well!), but all of them have this junk in their output: and I haven't seen this in about 1000x runs on an ubuntu vm in virtualbox. |
Can you try using a Docker container? Usually, I use the
As before, the error occurs on assert ( Also, forcing the process exit code to - process.exit(0); |
after running the full suite in the same ubuntu vm, I am seeing the same "Warning: got packets out of order", but those tests don't fail, so that's odd. I'll try to get docker running
I'd agree that warnings (in themselves) don't cause test failures. I'd also postulate that if network comms to the mysql server are not running correctly, writing code that assumes that it can query data from the database without error may well be in error. I only saw these warnings on the ubuntu GHA hosts, until right now when I ran the full set of tests (but I only see those warnings on other tests which aren't failing). What I've read about that warning suggests that data can be lost during transmission when that occurs - which would explain the failure. |
Can you please revert the changes in the |
Sorry about that, but I don't see an advantage to change MySQL version on Node / Bun CI. It should fit more in |
similarly, there's no disadvantage; however I've reverted. |
When upgrading from
mysql
tomysql2
, to support authentication updates on our mysql server(s), I found that my code around streaming, particularly when streams contain multiple resultsets, wasn't working properly because the resultset index wasn't being passed through as it is inmysql
. This PR aims to resolve that.