Skip to content
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

Product update not reliable #173

Open
martflu opened this issue Dec 19, 2019 · 0 comments
Open

Product update not reliable #173

martflu opened this issue Dec 19, 2019 · 0 comments

Comments

@martflu
Copy link

martflu commented Dec 19, 2019

Description

While doing some performance testing on the product importer I stumbled upon an issue with update consistency.

The test case is importing a list of 100 products with minimal information (name, slug, productType and sku) and a description with around 200 characters. The import is then executed again with the same products but with a new/altered description.
I use following command to start the import:

time sphere import -p import-test-100 -t product -f products.json -c '{"errorDir": "./errors"}' -b 10

Expected Behavior

Running the import for the first time should create all products. Running the import again with the altered descriptions should result in all products being updated to the new description.

Current Behavior

Starting the first import on an empty project (except for the productType) completed with the following information:

info:
{
  reportMessage: 'Summary: there were 100 imported products (100 were new and 0 were updates).',
  detailedSummary: {
    productsWithMissingSKU: 0,
    created: 100,
    updated: 0,
    failed: 0,
    productTypeUpdated: 0,
    errorDir: './errors'
  }
}

Running the same import again with altered descriptions in the products.json results in 101 warnings similar to this:


...
warn:    Recovering from 409 concurrentModification error on product 'cc318ff9-4153-4fcc-9311-8bae0d0f6d17'
warn:    Recovering from 409 concurrentModification error on product '11e9513d-e934-4470-b8d1-710fa89ab1ec'
warn:    Recovering from 409 concurrentModification error on product '88acb4ba-371c-4fc6-8496-4d94dcbe814e'
warn:    Recovering from 409 concurrentModification error on product '2a8431d9-0888-4e9a-8939-321725dfcb1d'
warn:    Recovering from 409 concurrentModification error on product 'fece4576-1331-40d4-bd93-39ddfc09a8a5'
...

The final output information is:

info:
{
  reportMessage: 'Summary: there were 100 imported products (0 were new and 100 were updates).',
  detailedSummary: {
    productsWithMissingSKU: 0,
    created: 0,
    updated: 100,
    failed: 0,
    productTypeUpdated: 0,
    errorDir: './errors'
  }
}

Running the import again reduced the warnings to only 14 with output:

info:
{
  reportMessage: 'Summary: there were 18 imported products (0 were new and 18 were updates).',
  detailedSummary: {
    productsWithMissingSKU: 0,
    created: 0,
    updated: 18,
    failed: 0,
    productTypeUpdated: 0,
    errorDir: './errors'
  }
}

After running the import 5 times there were no more updates in the output information which suggests that in the end all updates went through.

Is this expected behavior? How can I make sure that all products are updated correctly without having to rerun the import multiple times?

@martflu martflu closed this as completed Dec 19, 2019
@martflu martflu reopened this Dec 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant