bisakhmondal commented on pull request #1583:
URL: https://github.com/apache/apisix-dashboard/pull/1583#issuecomment-799639410
Hello guys, I am facing a problem here.
There is one fundamental thing I made in this PR that is wrong.
Ginkgo is fully based on running **mutually independent** tests parallelly.
And it executes the codes inside the nested `It` Blocks
parallelly/concurrently, but the current PR lacks synchronisation in tests
execution(which is needed here). And there is no support for serial execution
in ginkgo (as per their ideology there should not be, tests that should be
independent which makes sense in some way).
But the codes in `route_import_test` share a lot of mutual dependencies. The
tests work if it gets executed in serial. As the whole route suite is executed
in parallel adding [this](https://pastebin.com/48BstkCw) snippet (just one test
case [after updating and making it a single test for testing]) to the existing
code falls under a racing condition (which was out of context for `e2e` module)
& breaks the whole test suite. The `route_import_test` involves updating the
state of the server & other tests are running based on the current state of the
server and the cleanups are done after each test suite, not for the individual
tests. So a lot of tests from the same suite is breaking, and the numbers are
really unpredictable :| (which clearly reflects some sort of racing is going
on).
Run-1
![image](https://user-images.githubusercontent.com/41498427/96365-3351c780-85e3-11eb-9527-948701ac6766.png)
Run-2
![image](https://user-images.githubusercontent.com/41498427/96527-6431fc80-85e3-11eb-9fed-2edb71f4692f.png)
Run-3
![image](https://user-images.githubusercontent.com/41498427/96613-7f047100-85e3-11eb-9d74-c7d2301f4736.png)
---
Another thing, ginkgo does not supports parameterization of `table.Entry` in
`table.DescribeTable` block. Internally in the parse tree the table.Entry are
treated a single It block. And ginkgo does not allows nested It block, so only
way left to do this kind of works
```go
var entries []table.TableEntry
table.DescribeTable("verify and delete route data",
func(tc base.HttpTestCase) {
base.RunTestCase(tc)
},
entries...,
)
```
Is to update the entries using `BeforeEach` block (which will eventually
involve sending a multipart form request & and get request) for each entry in
the entries slice, which is a poor design choice as it doesn't need to be
executed that many times.
So, now I'm out of ideas here. Any help would be really helpful. Thanks.
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org