I changed the way i am reading and parsing csv files into my js scripts. Previously I was using papaparse.js and now I am using open and csv structures from ‘k6/experimental/fs’ and csv from ‘k6/experimental/csv’.
I have multiple javascript files where I am having this structure declared before declaring the main function:
ScriptA
const file1 = await open(`../LT_data/${beneAccEnv}.csv`);
export const csvBeneAcc = await csv.parse(file1, {asObjects:true});
Script B
const file2 = await open(`../LT_data/${beneAccEnv}.csv`);
export const csvBeneAcc = await csv.parse(file2, {asObjects:true});
So, multiple scripts are taking data from this csv file. Then I created a scenario which is starting paralel threads with these scripts.
Sometimes when running the scenario i have this error:
level=error msg=“failed to create a new parser; reason: failed to read the first line; reason: EOF\n” hint=“script exception”.
Appears randomly (when running locally or using k6 agents).
This did not happened previously when using papaparse.js. It only happens now from time to time when using the experimental library. We do not have a pattern for this issue.