Repository: create-react-app
Issue: [internal] e2e:docker tests fails on lerna publish (works running each test suite separately)
Labels: tag: internal

First of all, thanks to all of you for the incredible job you've done with this project!

I tried to run `yarn e2e:docker`, both with and without the `--test-suite=all` flag and the second test suite (`./tasks/e2e-kitchensink.sh`) always fails. However, when running the tests separately, they all pass, including `e2e-kitchensink`. Also, when changing the order of the test suites in `tasks/local-test.sh` it is always the second the one that fails.

I believe it's because after `e2e-simple.sh` has run, the packages are published to the local npm registry (verdaccio), and this is not cleared after the test has finished running. So when the second test suite runs, it tries to publish packages with the same version numbers as the ones published by the first test suite.

```
+ git clean -df
Removing yarn.lock
+ ./tasks/publish.sh --yes '--force-publish=*' --skip-git --cd-version=prerelease --exact --npm-tag=latest
+ cd ..
+ root_path=/home/node/create-react-app
+ '[' -z true ']'
++ git status --porcelain
+ '[' -n '' ']'
+ cd packages/react-error-overlay/
+ npm run build:prod

> react-error-overlay@5.1.4 build:prod /home/node/create-react-app/packages/react-error-overlay
> cross-env NODE_ENV=production node build.js

Cleaned up the lib folder.

Compiling iframeScript.js
Hash: 72a9fa7b4fa42cd3b99e
Time: 5118ms
Built at: 2019-03-15 21:14:31
           Asset     Size  Chunks             Chunk Names
iframe-bundle.js  274 KiB       0  [emitted]  main
Entrypoint main = iframe-bundle.js

Compiling index.js
Hash: 0af3a2eb73eabe4e1fae
Time: 359ms
Built at: 2019-03-15 21:14:32
   Asset     Size  Chunks                    Chunk Names
index.js  326 KiB       0  [emitted]  [big]  main
Entrypoint main [big] = index.js

Compiled successfully!


+ cd ../..
+ otp=
+ '[' -z true ']'
+ NPM_CONFIG_OTP=
+ ./node_modules/.bin/lerna publish --independent --npm-client=npm --yes '--force-publish=*' --skip-git --cd-version=prerelease --exact --npm-tag=latest
lerna info version 2.9.1
lerna info versioning independent
lerna info Checking for updated packages...
lerna info Comparing with create-react-app@2.1.8.
lerna info Checking for prereleased packages...

Changes:
 - babel-plugin-named-asset-import: 0.3.1 => 0.3.2-0
 - babel-preset-react-app: 7.0.2 => 7.0.3-0
 - confusing-browser-globals: 1.0.6 => 1.0.7-0
 - create-react-app: 2.1.8 => 2.1.9-0
 - eslint-config-react-app: 3.0.8 => 3.0.9-0
 - react-app-polyfill: 0.2.2 => 0.2.3-0
 - react-dev-utils: 8.0.0 => 8.0.1-0
 - react-error-overlay: 5.1.4 => 5.1.5-0
 - react-scripts: 2.1.8 => 2.1.9-0

lerna info auto-confirmed 
lerna info publish Publishing packages to npm...
lerna ERR! publish Retrying failed publish: confusing-browser-globals
lerna ERR! publish Retrying failed publish: babel-plugin-named-asset-import
lerna ERR! publish Retrying failed publish: babel-preset-react-app
lerna ERR! publish Retrying failed publish: create-react-app
lerna ERR! publish Retrying failed publish: confusing-browser-globals
lerna ERR! publish Retrying failed publish: babel-plugin-named-asset-import
lerna ERR! publish Retrying failed publish: babel-preset-react-app
lerna ERR! publish Retrying failed publish: create-react-app
lerna ERR! publish Retrying failed publish: babel-preset-react-app
lerna ERR! publish Retrying failed publish: confusing-browser-globals
lerna ERR! publish Retrying failed publish: babel-plugin-named-asset-import
lerna ERR! publish Retrying failed publish: create-react-app
lerna ERR! publish Retrying failed publish: babel-plugin-named-asset-import
lerna ERR! publish Retrying failed publish: confusing-browser-globals
lerna ERR! publish Retrying failed publish: babel-preset-react-app
lerna ERR! publish Retrying failed publish: create-react-app
lerna ERR! publish Ran out of retries while publishing confusing-browser-globals Error: Command failed: npm publish --tag latest
lerna ERR! publish npm notice 
lerna ERR! publish npm notice package: confusing-browser-globals@1.0.7-0
lerna ERR! publish npm notice === Tarball Contents === 
lerna ERR! publish npm notice 427B  package.json
lerna ERR! publish npm notice 1.0kB index.js    
lerna ERR! publish npm notice 1.1kB LICENSE     
lerna ERR! publish npm notice 1.2kB README.md   
lerna ERR! publish npm notice === Tarball Details === 
lerna ERR! publish npm notice name:          confusing-browser-globals               
lerna ERR! publish npm notice version:       1.0.7-0                                 
lerna ERR! publish npm notice package size:  2.0 kB                                  
lerna ERR! publish npm notice unpacked size: 3.7 kB                                  
lerna ERR! publish npm notice shasum:        179cbb21ab06f646a1904443d998aeb218127e34
lerna ERR! publish npm notice integrity:     sha512-W63Df7oGlVMxA[...]djV0m03FFwJgQ==
lerna ERR! publish npm notice total files:   4                                       
lerna ERR! publish npm notice 
lerna ERR! publish npm ERR! code EPUBLISHCONFLICT
lerna ERR! publish npm ERR! publish fail Cannot publish over existing version.
lerna ERR! publish npm ERR! publish fail Update the 'version' field in package.json and try again.
lerna ERR! publish npm ERR! publish fail 
lerna ERR! publish npm ERR! publish fail To automatically increment version numbers, see:
lerna ERR! publish npm ERR! publish fail     npm help version
lerna ERR! publish 
lerna ERR! publish npm ERR! A complete log of this run can be found in:
lerna ERR! publish npm ERR!     /home/node/.npm/_logs/2019-03-15T21_14_36_841Z-debug.log
lerna ERR! publish 
lerna ERR! publish     at Promise.all.then.arr (/home/node/create-react-app/node_modules/lerna/node_modules/execa/index.js:236:11)
lerna ERR! publish     at <anonymous>
lerna ERR! publish     at process._tickCallback (internal/process/next_tick.js:189:7)
lerna ERR! execute callback with error
lerna ERR! Error: Command failed: npm publish --tag latest
lerna ERR! npm notice 
lerna ERR! npm notice package: confusing-browser-globals@1.0.7-0
lerna ERR! npm notice === Tarball Contents === 
lerna ERR! npm notice 427B  package.json
lerna ERR! npm notice 1.0kB index.js    
lerna ERR! npm notice 1.1kB LICENSE     
lerna ERR! npm notice 1.2kB README.md   
lerna ERR! npm notice === Tarball Details === 
lerna ERR! npm notice name:          confusing-browser-globals               
lerna ERR! npm notice version:       1.0.7-0                                 
lerna ERR! npm notice package size:  2.0 kB                                  
lerna ERR! npm notice unpacked size: 3.7 kB                                  
lerna ERR! npm notice shasum:        179cbb21ab06f646a1904443d998aeb218127e34
lerna ERR! npm notice integrity:     sha512-W63Df7oGlVMxA[...]djV0m03FFwJgQ==
lerna ERR! npm notice total files:   4                                       
lerna ERR! npm notice 
lerna ERR! npm ERR! code EPUBLISHCONFLICT
lerna ERR! npm ERR! publish fail Cannot publish over existing version.
lerna ERR! npm ERR! publish fail Update the 'version' field in package.json and try again.
lerna ERR! npm ERR! publish fail 
lerna ERR! npm ERR! publish fail To automatically increment version numbers, see:
lerna ERR! npm ERR! publish fail     npm help version
lerna ERR! 
```