-
Notifications
You must be signed in to change notification settings - Fork 235
chore(e2e): Don't do the "first run experience" every time COMPASS-5262 #2889
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
Conversation
packages/compass-e2e-tests/helpers/commands/exists-eventually.ts
Outdated
Show resolved
Hide resolved
The windows flake is just the same windows flake we're trying to fix elsewhere: #2891 (comment) |
import { inspect } from 'util'; | ||
import { ObjectId, EJSON } from 'bson'; | ||
import { promises as fs } from 'fs'; | ||
import { promises as fs, rmdirSync } from 'fs'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a specific reason that this method needs to be synchronous?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cleanup() in index.ts is synchronous and I need to call it there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See
compass/packages/compass-e2e-tests/index.ts
Lines 50 to 74 in a58edee
function cleanup() { | |
keychain.reset(); | |
const disableStartStop = process.argv.includes('--disable-start-stop'); | |
if (!disableStartStop) { | |
debug('Stopping MongoDB server and cleaning up server data'); | |
try { | |
crossSpawn.sync('npm', ['run', 'stop-server'], { | |
// If it's taking too long we might as well kill the process and move on, | |
// mongodb-runer is flaky sometimes and in ci `posttest-ci` script will | |
// take care of additional clean up anyway | |
timeout: 30_000, | |
stdio: 'inherit', | |
}); | |
} catch (e) { | |
debug('Failed to stop MongoDB Server', e); | |
} | |
try { | |
fs.rmdirSync('.mongodb', { recursive: true }); | |
} catch (e) { | |
debug('Failed to clean up server data', e); | |
} | |
} | |
} |
Basically: only calculate a userDataDir once. Only delete it if/when we ask for the "firstRun" experience explicitly and then during cleanup after all the tests.