隨機失敗的驗收測試錯誤:斷言失敗:在銷毀對像上調用集合 (randomly failing acceptance-tests with Error: Assertion Failed: calling set on destroyed object)


問題描述

隨機失敗的驗收測試錯誤:斷言失敗:在銷毀對像上調用集合 (randomly failing acceptance‑tests with Error: Assertion Failed: calling set on destroyed object)

我的一些驗收測試(涉及操作)在與所有其他測試一起運行時隨機失敗,但當我單獨運行它們時從未失敗。

錯誤:斷言失敗:調用集在我的操作中觸發了銷毀對象

我在以用戶身份使用表時沒有遇到任何問題,因此這些問題僅出現在測試中。所以我不確定這是否只是因為應用程序在每次運行後都沒有正確銷毀。

我能否以某種方式了解對象即將被銷毀的原因或哪些觀察者正在阻止它?

foos/index/route.js

startFoo(foos) {
  foos.forEach(function(foo) {
    foo.set('status', 'active');
    foo.save();
  });
},

這個 action 被傳遞到一個組件(表),它顯示了一個 <代碼>foo‑模型。


參考解法

方法 1:

Checking isDestroyed prior to setting should do the trick

isSelected: computed('table.selectedRows.[]', {
  get(/*key*/) {
    return this.get('table').isSelected(this.get('content'));
  },
  set(/*key, value*/) {
    if (this.get('isDestroyed')) {
      return;
    }
    this.get('table').selectRow(this.get('content'));
    return this.get('table').isSelected(this.get('content'));
  },
}),

(by MikePatsy Issa)

參考文件

  1. randomly failing acceptance‑tests with Error: Assertion Failed: calling set on destroyed object (CC BY‑SA 2.5/3.0/4.0)

#Testing #ember.js






相關問題

在線庫報告的錯誤 (Online repository for reported bugs)

INSTAL_PARSE_FAILED_NO_CERTIFICATES - 試圖在 robotsium 上測試不是我的 .apk 文件 (INSTAL_PARSE_FAILED_NO_CERTIFICATES - trying to test not my .apk file on robotium)

沒有模擬器的Android測試 (Android tests without emulator)

Protractor 測試框架的可重用函數 (Reusable functions for Protractor test framework)

隨機失敗的驗收測試錯誤:斷言失敗:在銷毀對像上調用集合 (randomly failing acceptance-tests with Error: Assertion Failed: calling set on destroyed object)

如何在嵌入式系統中執行回歸測試 (How to perform regression tests in embedded systems)

移動應用測試 (Mobile application testing)

互聯網瀏覽器測試 (Internet explorer testing)

在 VS2010 中創建帶有斷言的編碼 UI 測試的工作流程是什麼? (What is the workflow for creating a coded UI test with assertions in VS2010?)

谷歌播放保護阻止安裝我的調試 apk (Google play protect is preventing the installation of my debug apk)

如何使用 codeception seeRecord 函數來測試列的內容? (How can I use codeception seeRecord function for testing contents a column?)

將 JSON 文件作為 Post Request Flask 發送 (Sending JSON File as Post Request Flask)







留言討論