[GitHub] [apisix-dashboard] bisakhmondal commented on a change in pull request #1615: feat: manual deletion of apisix node data

2021-03-21 Thread GitBox


bisakhmondal commented on a change in pull request #1615:
URL: https://github.com/apache/apisix-dashboard/pull/1615#discussion_r598314148



##
File path: api/test/e2e/server_info_delete_test.go
##
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package e2e
+
+import (
+   "net/http"
+   "testing"
+)
+

Review comment:
   Thanks for the details. I think, it totally depends upon the scheduler 
to decide the ordering, modern schedulers such as go's makes a lot of fancy 
optimisation before executing something. For example, without going over the 
overhead of context switching between multiple goroutines for such small 
instruction, it may wait for others to finish and then start itself up.
   
   You can read the full issue in ginkgo mentioned in this 
[comment](https://github.com/apache/apisix-dashboard/pull/1615#discussion_r597392430).
   
   Now coming back to what you suggested, I had tried that, also even I had 
tried to comment out intermediate describe definitions & describeTable to make 
the test suite containing a single describe & describeTable container with a 
sleep timer of 2 whopping seconds in between all the tests. 2/5 times the suit 
fails. The code is available [here](https://pastebin.com/vbGmh9W0)
   TBH, I also get confused about seeing this erratic nature in ginkgo and 
after googling & reading the issue it's the only logical explanation that I 
came up with. 
   Thanks again.
   




-- 
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




[GitHub] [apisix-dashboard] bisakhmondal commented on a change in pull request #1615: feat: manual deletion of apisix node data

2021-03-19 Thread GitBox


bisakhmondal commented on a change in pull request #1615:
URL: https://github.com/apache/apisix-dashboard/pull/1615#discussion_r597597026



##
File path: api/test/e2e/server_info_delete_test.go
##
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package e2e
+
+import (
+   "net/http"
+   "testing"
+)
+

Review comment:
   Hey @starsz, Thanks for the suggestion but no, sadly it won't make any 
difference. Okay, I am trying my best to explain it again. They way ginkgo 
works, when we put any `table.Entry`  inside `Describe` block, ginkgo 
internally reduces it the same as `It` block. ginkgo blocks/holds the execution 
of any tests until it has collected all the `It` blocks and formed a parse tree 
kind of thing (you can check the behaviour locally by putting a time.Sleep("any 
large seconds") just after any `ginkgo.Describe` block, not a single test will 
run until all `It`s are available to be executed on that test suite). All `It` 
blocks are treated as single individual independent test entities. And then 
ginkgo runs all the tests (`It` blocks) in parallel/concurrently (in a 
nutshell, all `table.Entry`s will be run in parallel no matter where we keep it 
in the test suite).
   
   Hope it helps. Thanks again :)




-- 
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




[GitHub] [apisix-dashboard] bisakhmondal commented on a change in pull request #1615: feat: manual deletion of apisix node data

2021-03-18 Thread GitBox


bisakhmondal commented on a change in pull request #1615:
URL: https://github.com/apache/apisix-dashboard/pull/1615#discussion_r597392430



##
File path: api/test/e2e/server_info_delete_test.go
##
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package e2e
+
+import (
+   "net/http"
+   "testing"
+)
+

Review comment:
   Hii @Jaycean, thanks for the suggestion. I intentionally didn't go with 
ginkgo as it runs **independent** tests concurrently/parallelly. Going with 
ginkgo introduces a racing condition between tests if one of the tests alters 
data in the environment on which the success of other test cases largely 
depends (which is the case here, removing a node data before other tests on 
server_info runs causes a failure). It breaks the entire test suite. I have 
faced the same scenario, you could check 
[here](https://github.com/apache/apisix-dashboard/pull/1583#issuecomment-799639410).
   Still, I don't know any good hack to get around the issue. An alternative, 
not so good approach could be creating another suite for this type of scenarios 
(as we are running cleanups after each test suite) 
[ref](https://github.com/onsi/ginkgo/issues/294#issuecomment-305999281).
   
   Just for the reconfirmation. 
   
![image](https://user-images.githubusercontent.com/41498427/111729659-881c6900-8895-11eb-89e0-d5eacbbaa06f.png)
   Broke suite, haha.
   Thank you.




-- 
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