test(core): set proper malformed cookie instead of empty in server #1988
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why
This test https://github.com/artilleryio/artillery/blob/main/packages/core/test/core/test_cookies.js#L59-L80 is consistently failing. This started happening due to this dependency upgrade: 9dcda2a?short_path=053150b#diff-053150b640a7ce75eff69d1a22cae7f0f94ad64ce9a855db544dda0929316519 . Which moved tough-cookie from 4.0.0 (>2 years old) to 4.1.3.
How
This logic from
tough-cookie
salesforce/tough-cookie@1b25269#diff-2d82e6dd06f50c43f369547b8edcc1937fd3a9e403480d2e87541f6c125a70d9R462-R466 means that theCookie.parse
returns null, which causes the library to error. This is a check before looseMode, and seems to be intended behaviour. It seems looseMode is only intended for cookies that are non-empty.Fixes the test server by sending a malformed cookie that is non-empty.