Skip to content
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

Unit test for setting terminal task's state to COMPLETE #87

Open
tareq89 opened this issue Aug 2, 2016 · 1 comment
Open

Unit test for setting terminal task's state to COMPLETE #87

tareq89 opened this issue Aug 2, 2016 · 1 comment

Comments

@tareq89
Copy link
Member

tareq89 commented Aug 2, 2016

Background:

Can not update the terminal task's state from IN_PROGRESS to COMPLETED.

Request URL:http://taskcatdev.azurewebsites.net/api/job/57a06a9c85e54d25e4fec815/2a74b0f8-21a8-4780-9d3d-da1e9c0dad25
Request Method:PATCH
Status Code:400 Bad Request
Remote Address:104.214.29.203:80


HTTP/1.1 400 Bad Request
Content-Length: 3080
Content-Type: application/json
Server: Microsoft-IIS/8.0
Access-Control-Allow-Origin: http://127.0.0.1:8080
Access-Control-Allow-Credentials: true
X-Powered-By: ASP.NET
Set-Cookie: ARRAffinity=d5baaa4af13ed7a15d133cc9fb3175ad57c46ec6cfd3ea7a639bbc0f442a6612;Path=/;Domain=taskcatdev.azurewebsites.net
Date: Tue, 02 Aug 2016 12:18:44 GMT



Accept:application/json, text/plain, */*
Accept-Encoding:gzip, deflate, sdch
Accept-Language:en-US,en;q=0.8,bn;q=0.6
Authorization:Bearer rp0z_T6U4IVqG6kcX91B49hD51xLvMZlIj0c3nnxVaH_zacQaOHQkINg3BiVBUs6e1FNz00l5WkMIWTuFg5xyuk3HYGxN7LDpw7G0Cp60m0A3-BaVMkvg_ELGMWOe3AAEofhvyju3SbzHXw1bD3zuRhU_cYLzpRtz51mtsS-ca9Dx1XT14gtIU3WvpXm4uAuAmQPAJQvfHW5KTDMa41rDf6MhgHeF6JPH4-mim76uuAaTK5dwAPu_Cs_2Aam1phrFchBYUB9FerQiDvZvFGC1FbkrYsy4TDkDknV6Rd4uSw-U7pc2BAQhhmLpMB-eSSrCti6whdjDkCqnreacdXdW2kUrgCoFEysNxY6FwdKjHEDhCAN7BhygyAKnV_i9Cwl1IRw6eWFMfbsK9P_MQ-MSs-EagkoCfQbjRdyh_B5WEhNvv6CyFZOH-T1LPneXgslVEL9GGkfmiPPoJpfxZBzHZ68gV_NGzlfX1sXYeN3ksYUIJl6ylDG23YhGy0J0hWteCqcidwVFea1uT0CXD6RYHphrIc
Connection:keep-alive
Content-Length:54
Content-Type:application/json;charset=UTF-8
DNT:1
Host:taskcatdev.azurewebsites.net
Origin:http://127.0.0.1:8080
Referer:http://127.0.0.1:8080/
User-Agent:Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36




[{"value":"COMPLETED","path":"/State","op":"replace"}]

The error message I got:

{
  "ClassName": "System.NotSupportedException",
  "Message": "Setting Job State to COMPLETED when all the job Tasks are not completed",
  "Data": null,
  "InnerException": null,
  "HelpURL": null,
  "StackTraceString": "   at TaskCat.Data.Entity.Job.CompleteJob()\r\n   at TaskCat.Data.Entity.Job._terminalTask_JobTaskCompleted(JobTask sender, JobTaskResult result)\r\n   at TaskCat.Data.Model.JobTask.NotifyJobTaskCompleted()\r\n   at TaskCat.Data.Model.JobTask.MoveToNextState()\r\n   at TaskCat.Data.Model.JobTasks.DeliveryTask.UpdateTask()\r\n   at TaskCat.Lib.Job.JobRepository.<UpdateJobTaskWithPatch>d__11.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at TaskCat.Controller.JobController.<Update>d__11.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Threading.Tasks.TaskHelpersExtensions.<CastToObject>d__3`1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext()",
  "RemoteStackTraceString": null,
  "RemoteStackIndex": 0,
  "ExceptionMethod": "8\nCompleteJob\nTaskCat.Data, Version=0.1.3.53, Culture=neutral, PublicKeyToken=null\nTaskCat.Data.Entity.Job\nVoid CompleteJob()",
  "HResult": -2146233067,
  "Source": "TaskCat.Data",
  "WatsonBuckets": null
}

@thehoneymad
Copy link
Member

I think the bug should be solved, only the unit test should be remaining now

@thehoneymad thehoneymad added this to the Release 0.2.0 milestone Aug 2, 2016
@thehoneymad thehoneymad changed the title Can not update the Terminal Task's State to COMPLETED, need UNIT TEST to solidify this updating Unit test for setting terminal task's state to COMPLETE Aug 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants