bentonam / fakeit

Generates JSON documents based on models defined in YAML and adds them to a Couchbase Bucket
MIT License
86 stars 21 forks source link

Extra Data Randomly Appended to Output Files #153

Closed AlexRamey closed 6 years ago

AlexRamey commented 6 years ago

The output files sometimes will randomly have extra data appended after the final closing brace of the generated model. This seems like some buffer flushing issue. Not sure what's causing it. The random data doesn't seem to be coming from other files in the same run or from files generated by the previous run, but it's possible I missed something.

Here is some actual output. Everything after the closing brace (starting with "lastDayStatus") should not be there. I've added ** around what should be gone.

. . .
  "Created": 1503414324809,
  "createdBy": "esb-user",
  "Modified": 0,
  "modifiedBy": ""
}   **"lastDayStatus": "LOWSTOCK",
        "lastDayValue": 86
      },
      "newProductInfo": {
        "startDate": "2017-8-15",
        "endDate": "2017-8-22"
      },
      "merchandizeLayout": {
        "module": "target",
        "moduleDescription": "Kentucky",
        "area": "e-tailers",
        "aisle": "Forward",
        "sortSequence": "Maryland"
      },
      "listingType": "Assortment",
      "lockInfo": {
        "severity": "Fords",
        "description": "Tuna",
        "validFrom": "2017-8-16"
      }
    }
  ],
  "Created": 1503414324766,
  "createdBy": "esb-user",
  "Modified": 0,
  "modifiedBy": ""
}**
AlexRamey commented 6 years ago

UPDATE: I think the problem is that I'm generating multiple documents with the same file name in a given run sometimes. So I think the second one overwrites the first one, but if the first one was longer then its tail end is still there.

AlexRamey commented 6 years ago

solved by PR #170