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
#4734 Use separate mock api for each test #4928
Conversation
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.
👍 that's a lot of tests!
Looking good.
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.
Looks great 👍
By the way, I can see that test sometimes fails with below error. Need to be investigated and fixed.
|
@ioanmo226 I think it happened once, test passes well now, but let's monitor if it'll fail in the future. |
"test_ci_chrome_consumer_live_gmail": "npx ava --timeout=20m --verbose --concurrency=10 build/test/test/source/test.js -- CONSUMER-LIVE-GMAIL STANDARD-GROUP", | ||
"test_ci_chrome_consumer": "npx ava --timeout=20m --verbose --concurrency=10 build/test/test/source/test.js -- CONSUMER-MOCK STANDARD-GROUP", | ||
"test_ci_chrome_enterprise": "npx ava --timeout=20m --verbose --concurrency=10 build/test/test/source/test.js -- ENTERPRISE-MOCK STANDARD-GROUP", | ||
"test_ci_chrome_consumer_flaky": "npx ava --timeout=20m --verbose --concurrency=10 build/test/test/source/test.js -- CONSUMER-MOCK FLAKY-GROUP", |
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.
What is the purpose of the "flaky" group? These are resource-demanding tests or tests with unstable performance. This group is meant for tests to be run consequently, one at a time
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.
Some tests are inexplicably resource-demanding. When run in parallel with other tests, what can happen is that either that test will time out, or other tests will fail while the resource-intensive test hogs up resources.
Other reason that a test may end up in "flaky" section is if it needs to be executed serially for some other reason.
Generally speaking, these tests tend to cause reliability trouble when executed in parallel, for one reason or another.
Of course, they could be debugged and fixed one by one and moved, possibly, if we had the time or willingness.
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.
Does this mean we should set --concurrency=1
instead of --concurrency=10
?
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.
Yes, we can change it back to --concurrency=1
as browser pool size is automatically set to 1 for FLAKY-GROUP
- https://github.com/FlowCrypt/flowcrypt-browser/blob/master/test/source/util/index.ts#L31
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.
Shouldn't browser pool and concurrency always be exactly equal? Or is there a reason to have these two numbers diverge? I'd imagine, we could remove special code to choose that FLAKY-GROUP
has 1 in the pool, and instead follow whatever the provided --concurrency
?
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.
Probably it can be simplified, as currently --pool-size
parameter is used for determining oneIfNotPooled
, which then also used for setting ATTEMPTS
constant - https://github.com/FlowCrypt/flowcrypt-browser/blob/master/test/source/test.ts#L40
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.
BUILD_PATH=./build/test/mock-builds/port-$2-$(openssl rand -hex 12) | ||
mkdir -p $BUILD_PATH | ||
cp -r ./$1/* $BUILD_PATH | ||
grep ":8001" $BUILD_PATH -lr | xargs sed -i.bak -e "s/\:8001/\:$2/g" |
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.
Can it be solved with a [BUILD_REPLACEABLE_....]
placeholder?
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.
I suppose it could.. we would still need to do two rounds of replacing? The step that normally replaces [BUILD_REPLACEABLE_....]
and currently puts the :8001
would still need to insert some more maybe [TEST_REPLACEABLE_MOCK_PORT]
and then that would be replaced here.
It's true that as things are now, there is no meaning to the :8001
in particular. So that should not be put in, to not be confusing. So [TEST_REPLACEABLE_MOCK_PORT]
or similar would be a better choice here.
This PR implements separate mock api for each test:
AvaContext
close #4734
Tests (delete all except exactly one):
To be filled by reviewers
I have reviewed that this PR... (tick whichever items you personally focused on during this review):